A backup that stopped landing
The backup-age maintenance duty (#13331) files one issue when the newest backup in the
backup directory is more than 36 hours old: a missed night is loud once, not silent.
- What it watches. The newest regular file under
FORGE_SNAPSHOT_DIR, by modification
time. File times only; nothing is opened, run or shelled out to. Symlinks are not followed.
- The limit. 36 hours: a nightly, a missed night's slack, and a retry.
- The issue. "The newest backup is older than 36 hours", naming the age in hours, the
newest file's path and when it last changed. While one is open a later run files none
(fileIssueOnce); closing it lets the next miss file a new one.
- Quiet cases.
FORGE_SNAPSHOT_DIRunset (a bucket destination has no file times here),
a directory with no file yet, and a backup under 36 hours old.
- Too big to read. The walk stops at 100,000 entries. A cut walk may have missed the newest
file, so the duty then judges no age and files nothing; its finding says the directory was not read.
- Not the off-box alarm. The flow alarm
alarm_backup(#10924) fires at 26 hours on the
newest copy that left the machine, from the snapshot record. This duty reads the local directory's files themselves, so it catches a record that says a backup landed while the files are not there or not fresh, and a directory nothing is writing to. The limits differ on purpose: the alarm is a live banner for the off-box copy, this is one issue for the local one.
- The duty runs hourly, spends no money, and has a row on the maintenance board.
- Tests.
test/maintain-backup-age.test.ts: fresh is quiet, 40 hours files one issue
naming age and path and not again, symlinks and the entry cap, the board row.