fix(backup): no last-backup time after a failed dump #12
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/backup-status-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The nightly backup no longer writes
~/Backups/status/last-backupafter a run in which a dump failed or a Sögin dump was skipped. It says so on standard error, and the Sögin health page keeps the last good time until it reads Gamalt after 26 hours.This is C-WR-03 of the Sögin phase 3.1 review (open threat T-03.1-60, gap G-03.1-1). Before, every dump swallowed its failure, so
last-backupgot a fresh time after a snapshot that held a stale or missing dump.How
DUMP_FAILED=0at the top ofbackup/run.sh.DUMP FAILEDbranch.dump_sogin("not running, skipping") anddump_sogin_media("no volume, skipping") set it too, because the demo now runs both and a skipped Sögin dump means the snapshot lacks Sögin's data.write_backup_statuschecks the flag first: when set it printsbackup-status: not written, a dump failed or a Sögin dump was skipped; the health page keeps the last good timeto standard error and returns 0.write_backup_statusis still the last step of thebackup)branch. The exit status, the restic calls and the dumps are unchanged: a failed dump still lets the rest of the backup run.backup/README.mdsays whenlast-backupis not written.Two choices for you
sogin-dump.sql,sogin-media.tar, and so on) is left in place, so the snapshot still holds a restorable copy. The review's optional "rename the stale tar" is not taken.Trial (stub podman first on PATH, mktemp folders, restic never called, no live container, volume or
~/Backupstouched)The desk keeps no test files and has no fmt, lint or test task for
backup/; as in PR #11, the check issh -nplus a trial that sources the functions.run.sh:dump_soginfailed,DUMP_FAILEDdid not exist, the trial exited 1.sh -n backup/run.sh: ok.pslistingsogin-postgres,volume existsyes,execandvolume exportfailing:dump_soginsets the flag;dump_sogin_mediasets the flag;write_backup_statuswrites nolast-backupand prints the reason; with the flag back at 0 it writes2026-11-13T19:34:36Z(ISO-8601 UTC), folder 755, file 644, onlylast-backupin the folder.pslisting nothing andvolume existsno:dump_forgejo,dump_kumaanddump_vaultwardenskip and leave the flag at 0;dump_soginanddump_sogin_mediaskip and set it; the status folder is not created.pslistingforgejoandexecfailing:dump_forgejo'sDUMP FAILEDbranch sets the flag.grep -c 'DUMP_FAILED=1' backup/run.shprints 7;write_backup_statusis still the last line of thebackup)branch;backup/include.txtis unchanged (noBackups/status).After merging
git pullin~/Projects/workdesk(the backup timer runsrun.shfrom that checkout). No backup needs to run now; the next nightly run uses the new script.Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com
🤖 Generated with Claude Code