PBS retention and prune simulator

See exactly which backups survive your keep-hourly, keep-daily, keep-weekly, keep-monthly and keep-yearly rules, two years out.

Proxmox Backup Server prune rules keep the most recent backup for each time bucket up to the limit you set. A backup is retained if at least one rule chooses to keep it. This simulator generates synthetic backups at your chosen frequency, applies the same algorithm PBS uses, and shows the result as a per-month timeline so you can dial in a policy visually instead of guessing.

Common policies

Your retention policy

0
14
4
6
0

What you keep

Backups generated over 2 years at the chosen frequency

730

Backups kept after prune

24

Backups pruned

706

keep-hourly0
keep-daily14
keep-weekly4
keep-monthly6
keep-yearly0

24 months of retained backups

Each column is one month. Bar height is the number of backups retained that month.

How PBS prune works

  1. PBS groups backups into time buckets: hour of day, day of month, ISO week of year, calendar month, calendar year.
  2. For each keep-xxx rule, PBS keeps the most recent backup in each bucket, up to the rule's count. A backup is retained if at least one rule chooses to keep it.
  3. Rules combine with OR logic. keep-daily 7 + keep-weekly 4 does not keep 11 unique backups; it keeps 7 daily plus up to 4 more weekly that are not already kept as daily.
  4. This simulator runs the same algorithm over a synthetic series of backup timestamps at your selected frequency for 24 months, so the result reflects what PBS would actually keep.

About the simulator

Does this match the real PBS prune algorithm?
The bucket rules (hour, day, ISO week, month, year) follow the PBS documentation and behave the same way as the real pve-backup-client prune on synthetic input. Real-world runs can differ if your backups have irregular timestamps, if jobs are skipped, or if you mix protected snapshots; the simulator assumes clean periodic snapshots.
Why do my numbers not match keep-hourly + keep-daily exactly?
Because the rules overlap. The most recent backup of the current day is simultaneously the most recent of the current hour, the current week, the current month and the current year. It only counts once in the retained set.
Should I set all five keep-xxx rules?
For most fleets, keep-daily, keep-weekly and keep-monthly are enough. keep-hourly matters for write-heavy workloads where four-hour recovery windows are too long. keep-yearly is mostly a compliance artifact.
Does retention affect my storage cost linearly?
No. PBS content-defined chunking deduplicates aggressively across retained backups, so a 12-month retention is typically 2 to 4 times the storage of a 1-month retention, not 12 times. Use our storage calculator to get a tier-specific estimate.

Put your retention policy into production

Apply the same rules to a Cloud-PBS managed datastore in minutes. No code changes on your Proxmox VE side.