Set a retention policy
Retention decides how much history you keep: N daily, N weekly, and N monthly snapshots per project. Dockstash maps your policy directly onto restic forget --prune, run by a scheduled prune job — so old snapshots are trimmed automatically and the repository stays compact without ever touching recent restore points.
How to do it
Open Settings → Retention
Retention is configured centrally under Settings. Your plan caps the window: Free keeps 7 days, Pro 30, Business 90 — the policy you set is clamped to your tier’s ceiling.
Choose the keep counts
A solid default: keep 7 daily, 4 weekly, 6 monthly. That gives you day-granular restores for a week, week-granular for a month, and month-granular for half a year — while the repository stays small thanks to restic deduplication.
Schedule the prune job
Add a weekly prune schedule on each project. Your keep counts translate one-to-one into restic forget flags — the command below is exactly what a 7/4/6 policy runs. Prune is its own job kind because it locks the repo and deletes data; it never piggybacks on a backup.
restic forget --prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6Verify pruning works
After the first prune completes, check the project card: the snapshot count should flatten out and repo size should stabilize instead of growing forever. The Snapshots timeline shows exactly which restore points remain.
Do it in one click with Dockstash
Dockstash runs the exact dump above, restics it off-site, and drill-tests the restore automatically — no script to maintain.
Last updated: July 2026
Related guides
Schedule automatic backups
Set a daily backup, a weekly prune with retention, integrity checks, and restore drills — validated cron, one job per repository, live logs.
Configure storage destinations
Point Dockstash at your own storage VPS over SSH, save the one-time encryption password, and plan for total-loss recovery.
PostgreSQL
Back up PostgreSQL in Docker
ClickHouse
Back up ClickHouse in Docker
Frequently asked questions
Does pruning ever delete my only recent backup?
No. Keep-counts always preserve the most recent snapshots in each bucket — pruning trims the old tail, never the fresh head. A 7-daily policy always retains the last seven daily snapshots.
What happens to retention if I downgrade my plan?
The retention cap of the new tier applies going forward, and existing backups are never deleted on downgrade — over-cap projects are paused (read-only), not purged.
Why is my repository still large after pruning?
restic forget removes snapshots; the --prune pass then repacks and frees unreferenced data. Space drops after prune completes, not after forget alone — check the prune job’s log for the repacking summary.
Do I need prune if I have few snapshots?
Eventually, yes. Without prune every snapshot lives forever and the repo grows without bound. A weekly prune with sane keep-counts is cheap insurance against a full storage disk — which is itself a backup failure mode.