How to configure restic forget
and keep your storage sane

Without a retention policy, your restic repository grows forever. This page explains forget, prune, and how to set up a policy that balances recovery options against storage cost.

How restic retention works

Restic never deletes snapshots automatically. You run restic forget with flags that describe which snapshots to keep, and restic marks the rest for deletion. The --prune flag then removes the underlying data in the same command.

Important: restic forget without --prune only removes snapshot references. The data is still in the repository and still uses storage until you run restic prune.

Common retention policies

# Minimal: 7 days + 4 weeks
restic forget \
  --keep-daily 7 \
  --keep-weekly 4 \
  --prune

# Standard: daily + weekly + monthly
restic forget \
  --keep-daily 7 \
  --keep-weekly 4 \
  --keep-monthly 6 \
  --prune

# Comprehensive: daily + weekly + monthly + yearly
restic forget \
  --keep-daily 7 \
  --keep-weekly 4 \
  --keep-monthly 12 \
  --keep-yearly 2 \
  --prune

What each flag means

  • --keep-daily N:Keep the most recent snapshot from each of the last N days that had at least one snapshot.
  • --keep-weekly N:Keep the most recent snapshot from each of the last N calendar weeks.
  • --keep-monthly N:Keep the most recent snapshot from each of the last N calendar months.
  • --keep-yearly N:Keep the most recent snapshot from each of the last N years.
  • --keep-last N:Always keep the last N snapshots regardless of time. Useful as a safety floor.
  • --keep-within 30d:Keep all snapshots within the last 30 days. Good for compliance windows.

Targeting by host or tag

If you back up multiple machines to the same repository, always target forget by host or tag to avoid accidentally pruning another machine's snapshots.

# Forget only snapshots from this host
restic forget \
  --keep-daily 7 \
  --keep-weekly 4 \
  --host $(hostname) \
  --prune

# Forget only snapshots with a specific tag
restic forget \
  --keep-daily 7 \
  --keep-weekly 4 \
  --tag production \
  --prune

Running prune on a schedule

Run forget as part of every backup script so your repository stays clean automatically. Separate prune jobs are only needed if you want to defer the I/O cost of cleanup.

restic backup /etc /var/www /home --tag daily
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --tag daily --prune
restic check

Storage cost estimates

With deduplication, the actual storage of a daily backup policy depends on your change rate. For a typical server with 50GB of data and a 5% daily change rate, 7 daily + 4 weekly snapshots uses roughly 60-80GB. ServerCrate's 100GB Starter plan at $5/month covers most single-server setups cleanly.

Retention by plan on ServerCrate

ServerCrate enforces a maximum snapshot retention window per plan - 7 days on Free, 30 days on Starter, 60 days on Standard, 90 days on Pro. Your restic forget policy should be set to not exceed these windows, or older snapshots will still count against your storage quota without being accessible from the portal.

Align your forget policy with your plan. For a Standard plan (60-day retention), a policy of --keep-daily 7 --keep-weekly 8 --keep-monthly 2 gives you 8 weeks of weekly snapshots plus 2 monthly snapshots - all within the 60-day window.

The difference between forget and prune

This trips up many users. restic forget removes snapshot references from the repository index. But the actual data blocks those snapshots referenced are still physically present in the pack files. Storage is not reclaimed until you run restic prune.

Running restic forget --prune does both in one command. Running restic forget alone is useful if you want to defer the I/O cost of prune to off-peak hours, or if you want to inspect what would be deleted before committing. In practice for most setups, just always pass --prune to forget.

Restic forget with multiple hosts in one repository

If you back up multiple machines to a single ServerCrate vault - which Standard and Pro plans support - always scope your forget commands by host or tag. Without scoping, forget applies across all snapshots in the repository and may prune snapshots from other machines.

# Safe: scoped to this host only
restic forget --keep-daily 7 --keep-weekly 4 --host $(hostname) --prune

# Dangerous: applies to ALL hosts in the repository  
restic forget --keep-daily 7 --keep-weekly 4 --prune

Tag each machine's backups on creation with --tag $(hostname) and then target forget with --tag $(hostname) to keep host-level policies separate and predictable.

FAQ

Common questions.

--keep-daily 7 --keep-weekly 4 --keep-monthly 3 gives you a week of daily recovery, a month of weekly recovery, and three months of monthly recovery. That covers accidental deletion, ransomware, and most incident scenarios.
No. restic forget marks snapshots as deletable. The actual data removal happens when you run restic prune, or when you pass --prune to the forget command.
No. Once forget runs and you prune, the data is gone. Run restic snapshots before forget to verify what will be kept, or use --dry-run to preview.
Run restic forget --keep-daily 7 --keep-weekly 4 --dry-run. It shows which snapshots would be removed without actually deleting anything.
Get started today

Start backing up with the right retention.

Flat pricing. No per-snapshot fees.

No egress fees, cancel anytime, 7-day money-back guarantee