feat(backup): back up Sögin Media and record the last good backup #11

Merged
jonnxor merged 1 commit from feat/sogin-media-backup into main 2026-11-11 17:17:11 +00:00
Owner

Adds Sögin's Media to the nightly backup and records when the last good backup finished.

  • dump_sogin_media exports the Media Podman volume to ~/Backups/sogin-media/sogin-media.tar through 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.txt gains the folder.
  • The volume name is systemd-sogin-media: Quadlet names a .volume unit without VolumeName with a systemd- prefix. SOGIN_MEDIA_VOLUME overrides it.
  • write_backup_status writes the current UTC time (ISO-8601) to ~/Backups/status/last-backup as the last step of backup, so after both restic runs and both prunes succeed (set -e stops before it otherwise). A failed run leaves the last good time. Temp file then rename; folder 755, file 644.
  • The status folder is not in include.txt, so a restore never writes an old time over a newer one.
  • The servers PR (03.1-35) mounts the status folder read-only into the API, for the health page.

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.sh passes.

Co-Authored-By: Claude Sonnet 5.5 noreply@anthropic.com

Adds Sögin's Media to the nightly backup and records when the last good backup finished. - `dump_sogin_media` exports the Media Podman volume to `~/Backups/sogin-media/sogin-media.tar` through 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.txt` gains the folder. - The volume name is `systemd-sogin-media`: Quadlet names a `.volume` unit without `VolumeName` with a `systemd-` prefix. `SOGIN_MEDIA_VOLUME` overrides it. - `write_backup_status` writes the current UTC time (ISO-8601) to `~/Backups/status/last-backup` as the last step of `backup`, so after both restic runs and both prunes succeed (`set -e` stops before it otherwise). A failed run leaves the last good time. Temp file then rename; folder 755, file 644. - The status folder is not in `include.txt`, so a restore never writes an old time over a newer one. - The servers PR (03.1-35) mounts the status folder read-only into the API, for the health page. 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.sh` passes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
feat(backup): Sögin Media dump and the last-backup status file
All checks were successful
CI / sanity (pull_request) Successful in 5s
5c21adfd04
- dump_sogin_media exports the systemd-sogin-media volume to an owner-only tar, skipped until the volume exists
- write_backup_status records the UTC time after both restic runs and prunes succeed, outside include.txt
- include.txt and the README name both

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
WAAAGH/_workdesk!11
No description provided.