vps-health-api/agent/pg-backup-pull
le king fu f81a80e325
All checks were successful
CI / verification (pull_request) Successful in 32s
fix(agent): anchor the backup rotation on the newest backup, not today
The rotation cutoff was TODAY minus 29 days. When the VPS stops
producing (dead cron, failing pg_dump) or this machine's clock jumps
ahead, the last off-site copy aged out after 30 days, the pass exited 0
and the report said ok on a directory it had just deleted. The cutoff
now comes from the newest dated directory held here, which is never
removed.

Review suggestions:
- --prune-empty-dirs: a dated directory with no .age file is not
  created, and one found empty logs a warning;
- files counts the dated directory only (-maxdepth 1), not partial
  files left in .rsync-partial/;
- an EXIT trap removes the header file holding the ingest token, with
  TERM/INT/HUP turned into an exit so a stop by systemd runs it.

Refs maximus/la-compagnie-maximus#220

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:03:48 -04:00
..
maximus-pg-backup-pull.service feat(agent): daily pull of the encrypted PostgreSQL backups 2026-10-10 16:18:17 -04:00
maximus-pg-backup-pull.timer feat(agent): daily pull of the encrypted PostgreSQL backups 2026-10-10 16:18:17 -04:00
run-pg-backup-pull.sh fix(agent): anchor the backup rotation on the newest backup, not today 2026-10-10 19:03:48 -04:00