A restic retention policy is a set of --keep-* rules that decide which snapshots survive when you run restic forget. Restic never deletes anything on its own, so without a policy a repository grows for as long as you keep backing up. A working policy for most homelab and small-business setups is restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --keep-yearly 1 --prune. That keeps every day of the last week, one snapshot per week for a month, one per month for half a year, and one per year beyond that.
Two commands do different jobs. forget removes snapshot references and is instant and reversible until you prune. prune reclaims the actual disk space by deleting unreferenced data chunks, takes far longer, and is irreversible. Always run forget with --dry-run first to see exactly which snapshots would go.
On this page
How restic forget and prune work
Restic never deletes snapshots on its own. restic forget applies your --keep-* rules; restic prune then deletes the chunks nothing references, which is what frees storage. restic forget --prune does both, or run forget alone to defer prune's I/O to off-peak hours.
Common retention policies
Most setups use one of three policies, depending on how far back you need to restore: a month, six months or two years. Each block is a complete command; the free retention calculator shows every restore point a policy keeps.
# 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 \
--pruneWhat each flag means
Each --keep-* flag keeps the newest snapshot in a time bucket. Flags combine: a snapshot survives if any rule keeps it, so --keep-last works as a safety floor under the calendar rules.
- --keep-daily <N>:Newest snapshot from each of the last N days that had one.
- --keep-weekly <N>:Newest snapshot from each of the last N calendar weeks.
- --keep-monthly <N>:Newest snapshot from each of the last N calendar months.
- --keep-yearly <N>:Newest snapshot from each of the last N years.
- --keep-last <N>:The last N snapshots regardless of time. A safety floor.
- --keep-within 30d:Every snapshot from the last 30 days. Good for compliance windows.
- --keep-tag <tag>:Never forget snapshots carrying this tag. Use it for legal holds.
Retention on ServerCrate vaults
Every ServerCrate vault has two endpoints on the same repository. The backup endpoint your servers write to is append-only: it can add snapshots but cannot delete or change them, so a compromised host cannot wipe your history.
The maintenance endpoint has full access and its own key; forget and prune run there. Create the key with the Cleanup key button on your vault in the portal. It is shown once.
Run retention from one trusted machine, never from the hosts you back up:
restic -r rest:https://maint:<maintenance-key>@<vault-id>-maint.vault.servercrate.net/ \
forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --pruneYour repository password is the same on both endpoints. The cleanup key only controls who is allowed to delete.
Running prune on a schedule
Schedule forget so the repository stays clean on its own. Weekly prune is the usual balance: daily wastes CPU and locks the repository, monthly lets dead chunks pile up. On ServerCrate, run it from the machine holding the cleanup key.
Storage cost estimates
With deduplication, storage depends on your change rate. A server with 50 GB of data and a 5% daily change rate uses roughly 60 to 80 GB under 7 daily plus 4 weekly snapshots.
The 250 GB Starter plan at $3/month covers most single servers. Longer retention costs less than it looks, because unchanged data is stored only once across all snapshots.
Retention by plan on ServerCrate
Each ServerCrate plan has a maximum snapshot retention window. Keep your forget policy inside it, or older snapshots still count against your quota without being reachable from the portal.
| Plan | Retention window |
|---|---|
| Free | 7 days |
| Lite | 14 days |
| Starter | 30 days |
| Standard | 60 days |
| Pro | 90 days |
| Business | 180 days |
For a Standard plan (60 days), --keep-daily 7 --keep-weekly 8 --keep-monthly 2 gives 8 weekly plus 2 monthly snapshots, all inside the window.
Restic forget with multiple hosts in one repository
If several machines back up to one ServerCrate vault (every plan supports this up to its device limit), always scope forget by host or tag. Without a scope, forget applies to every snapshot in the repository and can prune other machines' history.
# 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 --pruneTag each machine's backups with --tag $(hostname) when you create them, then target forget the same way. Both scoping styles in full:
# 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 \
--pruneRestic retention policy FAQ
Further reading
Retention only decides what to keep. Proving those snapshots are readable is a separate job. See how to verify restic backups, and if you want the whole thing running unattended, a systemd timer handles scheduling without cron.
A retention policy only protects you if the repository host cannot be pruned by an attacker; our comparison of restic hosts shows which ones support append-only.