Retention based on age of backup

Jun 25, 2025
2
0
1
We have a namespace on PBS where our Proxmox users can put « manual backups », this is backups they want to do before for example starting an upgrade or for any use they need (please note that our current main storage do not support snapshots). Currently there is no prune job on this namespace so it is only growing. Is there a way a prune job can be configured to delete say backups older than 3 months? I can't figure how to do that with the options of the prune jobs.
 
Apparently there is no way to achieve this goal (pruning backups older than 3 months) with the tools provided in the web interface. "Keep Daily = 91" do not work (it keeps 91 daily backups), I've also tried "Keep Monthly=1" but this will keep 1 monthly backup, even if the backup is multiple months old.

The good way to do this seems to be scripting. Writing a script listing the backups older than n months is relatively easy, I have now to figure how to pipe this to the CLI (proxmox-backup-client snapshot forget <snapshot> seems to be a good candidate).
 
The backup pruning is additive for lack of a better term. If you set 91 daily and 1 monthly you'll get 91 backups and then the last one of the month ending before that.

Or put another way, if you set "last 10" and then 5 daily (and don't run any extras) you'll end up with 15 daily backups.
 
  • Like
Reactions: Johannes S