Skip to content

fix(backups): keep every backup of the last week, so as-of restores find them - #65

Merged
thatbagu merged 1 commit into
mainfrom
fix/restore-retention
Nov 21, 2026
Merged

thatbagu merged 1 commit into
mainfrom
fix/restore-retention

Conversation

@thatbagu

Copy link
Copy Markdown
Owner

Found by the unattended --new-cluster rebuild on v1.24.2. It finished by itself, Longhorn's first sync included, but Pi-hole and WireGuard came back in an older state.

Why:

  1. The rebuild backs everything up (10:56).
  2. The new cluster takes its first backup of its fresh volumes the same day (11:19).
  3. That backup's restic forget, with keep-daily, keeps only the newest backup of each day, so it deleted the rebuild's backup.
  4. restore-all --as-of 10:56 then silently fell back to the newest snapshot before it, from the day before. That one happened to be a previous rebuild's fresh-volume backup.

Nextcloud wasn't affected: its database comes back from a dump, and its files hadn't changed.

Fix: the default per-app retention adds within = "7d" (--keep-within), so every backup of the last week stays. With the usual one backup a day, that costs nothing extra.

Test: vm-app-backups takes two backups the same day, then restores as of the first. It returns the first with the fix, and an older snapshot without it (both run locally).

Live: Pi-hole and WireGuard were restored from their last good snapshot (the 19th, verified in the earlier rebuild), and the data fingerprints are identical to before the rebuild. Fresh backups were taken right after.

🤖 Generated with Claude Code

…ind them

restic's forget kept only the newest backup of each day. A --new-cluster
rebuild backs up, then the new cluster backs up its fresh volumes the same
day: that backup's forget deleted the rebuild's, and restore-all --as-of
silently restored an older snapshot (on a live cluster, Pi-hole and
WireGuard came back as they were a day earlier, freshly installed). The
default per-app retention now also keeps everything within 7 days.

vm-app-backups gets the scenario: two backups the same day, a restore as
of the first must return the first (without the fix it returns an older
one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thatbagu
thatbagu merged commit b7aba8c into main Nov 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant