fix(backup): make backup_scheduler actually run; add freshness alerting
busybox crond reads <dir>/<user>, but the crontab was mounted at /etc/crontab, so no cron job had ever run: SQL dumps were last taken 2026-06-17 and the ntfy failure alerts never fired. Kopia's own server schedule kept file snapshots going until its cache broke on 2026-08-28, and nothing noticed for seven weeks. - mount crontab at /etc/crontabs/root and run crond -c /etc/crontabs - add hourly backup-check-freshness.sh: every Kopia source and the newest SQL dump must be <26h old and dumps must not be empty stubs; pushes UP/DOWN to the Uptime Kuma push monitor "Backups fresh" (#73), which also alerts via ntfy if no push arrives for 2h - scheduler joins edge to reach uptime_kuma; jq added; KOPIA password and KUMA_PUSH_URL exported to /etc/backup.env for cron's bare env - drop backup-run-snapshots.sh from cron (would duplicate the kopia server's 03:00 policy snapshots); keep it for manual runs - bookstack dump used an unset MYSQL_PASSWORD (empty 20-byte gzip); dump_mariadb now takes the password env var name - add immich-postgres and nextcloud-postgres dumps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
72688f48ac
commit
e0240d8e10
6 files changed
+96
-10
No files matched your search
+13
-2
@@ -32,8 +32,19 @@ Kopia → Backblaze B2. Backs up `/config`, **selected** `labdata` paths (see `S
|
||||
|
||||
| Time | What |
|
||||
|------|------|
|
||||
| 02:50 | `backup-dump-databases.sh` — SQL dumps |
|
||||
| 03:00 | Kopia snapshots (paths in `snapshot-paths.txt`) |
|
||||
| 02:50 | `backup-dump-databases.sh` — SQL dumps (`backup_scheduler` cron) |
|
||||
| 03:00 | Kopia snapshots — kopia server's own policy schedule (paths in `snapshot-paths.txt`) |
|
||||
| hh:15 | `backup-check-freshness.sh` — pushes to Uptime Kuma monitor **Backups fresh** |
|
||||
|
||||
## Alerting
|
||||
|
||||
`backup-check-freshness.sh` runs hourly and pushes UP/DOWN to the Uptime Kuma push monitor
|
||||
"Backups fresh (kopia + SQL dumps)" (`KUMA_PUSH_URL` in `stack.env`). DOWN when any Kopia source
|
||||
or the newest SQL dump is older than 26h, or a dump file is a near-empty stub. Kuma also goes
|
||||
DOWN if no push arrives for 2h (scheduler dead, kopia crash-looping), and notifies via ntfy.
|
||||
|
||||
`backup-run-snapshots.sh` is for manual runs only — cron'ing it would duplicate the server's
|
||||
scheduled uploads.
|
||||
|
||||
## If B2 creds are empty
|
||||
|
||||
|
||||
Reference in new issue
Block a user