How to Setup Retention When Multiple Backup Jobs on Same VM

tprice

New Member
Mar 27, 2025
9
3
3
Hi all,

I currently have 3 separate backup jobs for the same VMs, which run daily, monthly and quarterly. Daily is supposed to retain the last 30 jobs, monthly the last 6 and quarterly the last 4. I came to the realization today that the different jobs will be cleaning backups from the other jobs based on their own retention settings. What would be the best way to do multiple backups of the same VM, at different frequencies and retain different amounts for each schedule?
 
I currently have 3 separate backup jobs for the same VMs, which run daily, monthly and quarterly.

Yeah, that's not the usual approach. (But if it works for you... is is fine.)

Just run one job with the highest frequency (daily).

Learn how "pruning" works, use the Simulator: https://pbs.proxmox.com/docs/prune-simulator/

One single "Prune Job" can specify that you want to keep the latest 30 (or 30 daily, that's not the same!) and 6 monthly and 2 yearly backups. There is no "quarterly" though...
 
Last edited:
Yeah, that's not the usual approach. (But if it works for you... is is fine.)

Just run one job with the highest frequency (daily).

Learn how "pruning" works, use the Simulator: https://pbs.proxmox.com/docs/prune-simulator/

One single "Prune Job" can specify that you want to keep the latest 30 (or 30 daily, that's not the same!) and 6 monthly and 2 yearly backups. There is no "quarterly" though...
Having one backup job running daily and then pruning it down into what is needed daily/monthly/yearly makes a lot more sense. Would it be best to do the pruning from the PBS?
 
  • Like
Reactions: news and Johannes S
Would it be best to do the pruning from the PBS?
Well, it might be easier.

You can specify pruning rules in the backup job. If you have different groups of VMs with different rules and one job each.

I had a system with 20 jobs --> 20 times the same pruning rules --> that's hard to maintain. In that case it is obviously better to leave those "Retention"-Settings in the Backup Job empty and specify it once on the PBS.
 
  • Like
Reactions: news and Johannes S
Well, it might be easier.

You can specify pruning rules in the backup job. If you have different groups of VMs with different rules and one job each.

I had a system with 20 jobs --> 20 times the same pruning rules --> that's hard to maintain. In that case it is obviously better to leave those "Retention"-Settings in the Backup Job empty and specify it once on the PBS.
Coming back to this as I am missing something.

I currently have one daily backup of VMs, retention is set to keep all in PVE.

I then have a prune job in PBS which is set to keep 30 daily, and 12 monthly. I tried running this daily, and Monday/Wednesday/Friday. The only backups that are being kept is the 30 daily, what am I missing to have it keep a backup from each month for 12 months as well? I'm not sure if the version has something to do with it, I currently am on 3.1-2.

Thanks for the help,
 
I then have a prune job in PBS which is set to keep 30 daily, and 12 monthly. I tried running this daily, and Monday/Wednesday/Friday.
Please verify this in https://pbs.proxmox.com/docs/prune-simulator/

For me (in the simulator) 30 daily + 12 monthly would do what the labels say ;-)

(Small pitfall: adjust "Simulation Time Range" on the top right)
 
I’m in a similar situation with my backups and pruning setup. I realized that when I have daily backups, the system might take a bit to keep monthly backups, especially if the retention rules haven’t had enough time to cycle through. Has anyone here had experience with this wait time? Does it usually take an entire month before monthly backups start getting stored?
 
  • Like
Reactions: Lyula and tprice
there are no daily or monthly backups. there are just backups, and retention rules that specify which ones to keep. and yes, the retention rules are processed in order (first the "last" ones, then hourly, then daily, then monthly, ..)
 
  • Like
Reactions: Johannes S