feat(backup): back up Sögin Media and record the last good backup #11
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/sogin-media-backup"
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 Sögin's Media to the nightly backup and records when the last good backup finished.
dump_sogin_mediaexports the Media Podman volume to~/Backups/sogin-media/sogin-media.tarthrough a temp file moved into place on success. It is owner-only (umask 077, 700 folder), because staff files can include unpublished certificates, and uncompressed so restic deduplicates it. It skips with a message while the volume does not exist yet.include.txtgains the folder.systemd-sogin-media: Quadlet names a.volumeunit withoutVolumeNamewith asystemd-prefix.SOGIN_MEDIA_VOLUMEoverrides it.write_backup_statuswrites the current UTC time (ISO-8601) to~/Backups/status/last-backupas the last step ofbackup, so after both restic runs and both prunes succeed (set -estops before it otherwise). A failed run leaves the last good time. Temp file then rename; folder 755, file 644.include.txt, so a restore never writes an old time over a newer one.Tried on a throwaway volume (
sogin-media-trial-<pid>, removed afterwards): the tar lists the seeded file and is mode 600; a missing volume prints the skip line and creates nothing; the status file is ISO-8601 with mode 644 in a 755 folder.sh -n backup/run.shpasses.Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com