fix(pg-backup-pull): cap the backups at 30 days from today, even on a failed pull #72

Merged
maximus merged 4 commits from issue-71-pg-backup-cap into main 2026-10-28 01:43:02 +00:00

4 commits

Author SHA1 Message Date
le king fu
ec9af1de53 fix(pg-backup-pull): a failing chmod no longer stops the rotation and the report
All checks were successful
CI / verification (pull_request) Successful in 38s
CI / verification (push) Successful in 39s
Under set -eu, a chmod -R that failed (a file under DEST owned by someone
else) stopped the pass before the rotation and the report, now that it also
runs on a failed pull. It is now logged as a warning; DEST stays 700 (review
of PR #72).

Refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:34:23 -04:00
le king fu
b928b91ece fix(pg-backup-pull): keep files landed by a failed pull private
All checks were successful
CI / verification (pull_request) Successful in 39s
rsync cut by its timeout or a dropped link has already moved the whole files
into place, with the default modes. The chmod now runs on both paths, and the
comment that said nothing lands on a failed pull is gone (review of PR #72).

Refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:43:11 -04:00
le king fu
429ddda15a fix(pg-backup-pull): cap the backups at 30 days from today, even on a failed pull
All checks were successful
CI / verification (pull_request) Successful in 37s
The privacy policy promises backup copies kept 30 days at most. The rotation
was anchored on the newest local backup and skipped on a failed pull, so when
pulls stopped, copies older than 30 days stayed for good.

The rotation now runs on every pass, anchored on today (UTC): it keeps today
and the 29 days before it and removes every older dated directory, the last
copy included (Max, 2026-10-24). The latest-anchored pass is gone: since
latest is never after today, it never removed anything the cap does not.
latest and files are counted after the rotation. A failed pull is still
reported pull_failed with exit 2, a rotation failure then only logged.
A dated symbolic link is neither removed (rm -rf link/ would empty its
target) nor counted.

Refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:15:58 -04:00
le king fu
455918401e test(pg-backup-pull): reproduces #71, a failed pull leaves copies older than 30 days
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:12:37 -04:00