Max Backups - Can I allow a VM to have both daily and weekly backups without conflict?

mluck94

New Member
Apr 24, 2020
3
0
1
30
Hello,

I'm trying to set up a VM backup plan where I keep the last 3 dailies, PLUS the last 2 weekly backups (Sundays). I'm having trouble because the Max Backup rules are conflicting with each other. My backup settings are as follows:

- Two storage definitions pointing to the same share
- First storage has a Max Backup of 3
- Second storage has a Max Backup of 2
- Two Backup Plans are defined, first one is daily (excluding Sunday) the second is weekly on Sundays
- First backup plan uses Storage1 (max backup 3)
- Second backup plan uses Storage2 (max backup 2)

Here is the scenario. Sunday comes along and my weekly backup task runs as intended. Now Monday, and Tuesday pass and the daily backup task runs as well. All is good so far. Once Wednesday comes, the daily backup deletes my backup from Sunday because it sees 3 backup files on the storage. This has conflicted with my desire to want to ALSO keep the last 2 weekly backups. Is there any way to implement this without having to use two entirely different storage devices/shares?
 
prune settings similar to those used with PBS are available via the storage config ('prune-backups'), if your pve-manager and libpve-storage-perl are current:

Code:
--prune-backups [keep-daily=<N>] [,keep-hourly=<N>] [,keep-last=<N>] [,keep-monthly=<N>] [,keep-weekly=<N>] [,keep-yearly=<N>]
The retention options with shorter intervals are processed first with --keep-last being the very first one. Each option covers a specific period of time. We say that backups within this period are covered by this option. The next option does not take care of already covered backups and only considers older backups.

not yet exposed on the GUI, but should work.