Skip to main content

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:

  1. List snapshots (know what you have)
  2. Dry-run retention (see what would be removed)
  3. Apply retention (optionally with prune)
  4. 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

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.