Skip to main content

Retention Policy Design

Start with how far back you need to restore, then map that to keep rules.

Quick Summary

Retention is a restore decision:

  • If you need to be able to roll back 7 days, you must keep at least 7 daily snapshots.
  • If you need "one snapshot per week" for 2 months, keep ~8 weekly snapshots.

If you already have rsync + rclone jobs, retention is where Restic gives you more control than a simple mirror.

Step 1: Define Restore Goals

Answer these questions:

  • How far back do we need to restore for accidents? (example: 7 days)
  • How far back do we need to restore for rare bugs? (example: 4 weeks)
  • Do we need long history for compliance/audit? (example: 12 months)

Step 2: Translate Goals into Keep Rules

Example Policy

RequirementRule
7-day rollback--keep-daily 7
1-month rollback--keep-weekly 4
1-year history--keep-monthly 12
tip

Start with a small policy, then expand after you prove restores and storage behavior.

Command

restic forget \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 12 \
--prune

First Run Recommendation

Always preview first:

restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --dry-run

Then run the real command.

info

Apply separate retention rules per tag when datasets have different recovery requirements.

Common Mistakes

MistakeWhat happensFix
Applying retention without --dry-rununexpected snapshot removalalways preview first
One policy for everythingyou keep too much or too littleuse tags like db, media, app
No restore testing after retentionfalse confidencerun a small restore test after changes