feat(backup): dump the Sögin Postgres nightly #8
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/sogin-postgres-dump"
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?
Adds the Sögin Postgres to the nightly backup (DATA-02, D-06).
What changes
dump_sogininbackup/run.sh:pg_dumpfrom thesogin-postgrescontainer, plain SQL, through a temp file and a move, owner-only (700 directory, 600 file). A failed dump is logged loudly and does not abort the rest of the backup; the last good dump stays in place.--restrict-key=sogin, so two dumps of an unchanged database are byte-identical and restic can deduplicate them.backup/include.txtgains~/Backups/sogin-postgres.-- PostgreSQL database dump complete. The snapshot-age check is now 7.restore-sogincase andmise run backup:restore-sogin: pull the dump from the latest B2 snapshot into~/Backups/sogin-restore, which is never backed up. The restore trial itself lives in the sogin repo's runbook.Merge order, please read
Do not merge until the
sogin-postgresunit is deployed on hades and has been dumped once.The monthly verify (next run on the 1st) fails on a snapshot with no Sögin dump, so merging early makes the verify raise a false alarm. Until
sogin-postgresruns,dump_soginjust skips. The sogin repo's plan 02-12 does this in order: deploy, first dump, then this merge.Tested
sh -n backup/run.shdump_soginagainst a throwawaypostgres:17.11container: dump complete line present, mode 600, two runs byte-identical.pg_dumpleaves the previous dump untouched.restore-soginagainst a throwaway local restic repository (not B2).🤖 Generated with Claude Code