Safe Forget Prune Workflow
Use a repeatable sequence so retention changes do not quietly remove the restore points you need.
Quick Summary
Always do this in order:
- List snapshots (know what you have)
- Dry-run retention (see what would be removed)
- Apply retention (optionally with prune)
- Verify and do a small restore test
Runbook
safe-prune-runbook.sh
# 1) inspect current snapshots
restic snapshots --tag daily
# 2) dry-run retention
restic forget --tag daily --keep-daily 7 --keep-weekly 4 --dry-run
# 3) apply and prune
restic forget --tag daily --keep-daily 7 --keep-weekly 4 --prune
# 4) verify
restic snapshots --tag daily
restic check
Add a Restore Test (Recommended)
Pick one small file or folder that should always exist (for example an app config file) and test a restore:
mkdir -p /restore/retention-test
restic restore latest --target /restore/retention-test --include "/srv/app/config"
ls -la /restore/retention-test
warning
Do not combine first-time retention changes with unrelated backup script edits in the same production run.