diff --git a/scripts/check-backup-freshness.sh b/scripts/check-backup-freshness.sh index 820ff8f..c0c48bf 100755 --- a/scripts/check-backup-freshness.sh +++ b/scripts/check-backup-freshness.sh @@ -232,10 +232,17 @@ for want in $EXPECTED_NH3; do done # --- Layer: PBS VM images (newest per guest, all namespaces) --- +# ⚠ The age comes from the snapshot's NAME (its backup time, e.g. 2026-10-04T10:00:04Z), +# never from the directory's mtime (2026-10-06). PBS rewrites index.json.blob inside the +# snapshot dir at every verify (first one at the next 02:30, then every 30 days, from +# verification.cfg outdated-after 30) and on notes or protect edits, which moves the +# dir mtime forward. Measured: ana-pve/vm/101's 10-04 snapshot read "2026-10-06" here. +# A guest whose backups had stopped would alarm up to a day late, then go quiet again +# for ~2 days after each monthly re-verify. pbs=$($SSH pbs-ana 'for ns in /mnt/pbs-datastore/ns/*/; do n=$(basename "$ns") for d in vm ct; do for g in "$ns$d"/*/; do [ -d "$g" ] || continue nb=$(ls -d "$g"20*T* 2>/dev/null | sort | tail -1) - [ -n "$nb" ] && echo "$n/$d/$(basename "$g") $(stat -c %Y "$nb")" + [ -n "$nb" ] && echo "$n/$d/$(basename "$g") $(date -d "$(basename "$nb")" +%s)" done; done; done' 2>/dev/null) if [ -z "$pbs" ]; then errors+=("PBS-ANA: unreachable or no snapshots"); else for ns in "${!NS_NODE[@]}"; do load_jobs "$ns" || errors+=("coverage for namespace '$ns' UNREADABLE — nothing in it will be suppressed"); done