[SOLVED] Backup retention - "Keep last #" enforces a "max" limit

LooneyTunes

Active Member
Jun 1, 2019
203
23
38
Hi,

When configuring the backup retention, one option is to "Keep Last" number of backups, which is what I chose, and set it to 3. Doing so I'd expect it to rotate the oldest one out when I try to add the fourth. This worked initially great. When I added a USB storage a while back I noted this failed with below error for that one, while SSD kept working. Today neither of them work, so just guessing, but have this behavior changed?

So instead of starting a new backup, it gives me an error telling me I have set max limit of 3 backups, which is not how I interpret the config, nor how it initially worked...

If someone could please explain what is happening, I would really appreciate it. Thanks

Error I'm getting is
Code:
INFO: starting new backup job: vzdump 100 --storage local --mode snapshot --compress zstd --remove 0 --node pve
ERROR: Backup of VM 100 failed - There is a max backup limit of 3 enforced by the target storage or the vzdump parameters. Either increase the limit or delete old backup(s).
INFO: Failed at 2021-09-18 10:28:24
INFO: Backup job finished with errors
TASK ERROR: job errors
 
Only if you start the backup manually. Behavior is different if you start it as backup job.
Aha, then this has changed recently. Manual also don't mention this difference (/pve-docs/chapter-vzdump.html#vzdump_retention). It worked fine starting backup jobs manually before on 6.4 and also 7.0 until now, keeping only set amount of backups. Why not using the same retention for all methods, especially as the storage is the same regardless?
 
Aha, then this has changed recently.
AFAIK this has not changed (I implemented this feature years ago).
Manual also don't mention this difference (/pve-docs/chapter-vzdump.html#vzdump_retention). It worked fine starting backup jobs manually before on 6.4 and also 7.0 until now, keeping only set amount of backups. Why not using the same retention for all methods, especially as the storage is the same regardless?
It is the same retention (you just need to delete the backup manually). This is a security feature to prevent users from deleting backups unintentionally.
 
Last edited:
AFAIK this has not changed (I implemented this feature years ago).

It is the same retention (you just need to delete the backup manually). This is a security feature to prevent users from deleting backups unintentionally.
That is what is so strange. I have used this for about a year (longer in total, but with regularly taking backups) and up until today I have not had to delete the old ones, it just removed the oldest one... But if you say so... I have, since this stopped working for me, contradictory to what this feature wants to prevent, instead manually deleted the wrong one, aka not the oldest one. So could it please be made optional if this indeed is the intended behavior?
Still a bit of a mystery why this has worked as I though was right for so long...
 
Hi,
if you want to prune afterwards, use --remove 1 instead of --remove 0. If the backup is triggered via GUI, in the latest Proxmox VE 7, there should be a Prune checkbox (if there are retention settings configured) which sets that flag as well.
 
Please note that there are three different ways to start backups:

1.) Automatically scheduled backup job (Datacenter/Backup GUI)
2.) Manually started Backup Job (Datacenter/Backup GUI)
3.) Manual VM Backup (VM/Backup GUI)

Only 1 and 2 apply prune automatically.

I assume you previously started the backup job manually, instead of running a manual VM backup.
 
  • Like
Reactions: fiona
Hi,
if you want to prune afterwards, use --remove 1 instead of --remove 0. If the backup is triggered via GUI, in the latest Proxmox VE 7, there should be a Prune checkbox (if there are retention settings configured) which sets that flag as well.
Hi, yes there is, and when I check that prior to the backup, it starts as I would expect, and the same way it did before too. If this is the "fix", then its all good! Thanks for the tip on pruning!
 
I assume you previously started the backup job manually, instead of running a manual VM backup.
Well, I did both before and they started nicely. But as described above, with the pruning box checked, VM backup's are now back to the "old" behaviour I had become used to. This will work nicely. And guys, don't take me wrong, I love proxmox, thank you so much for sharing such great software! :)
 
Last edited: