Delete backups of deleted VMs

jmjosebest

Renowned Member
Jan 16, 2009
192
29
93
Hello,

regarding backup retention of removed VMs, I dont find any information.

In my case, I want to remove those backups after 1 week.

In my prune configuration, I have weekly = 1

But I see stored backups wich the last backup day is +1 month ago.

How to automate deletion of those backups?

Thanks!
 
Hi,
Backups of removed VMs will not be removed automatically, because pruning will keep the same backups each time if nothing changes. Pruning does not depend on the current time, it only cares about the timestamps of the backups. See here for how pruning works exactly.

EDIT: Used the correct reason.
 
Last edited:
So, I understand that to delete the backups of a deleted VM, it is an action that we must perform by hand.

Is this correct?
 
Last edited:
Yes. Some people wouldn't be happy if their backups just disappeared without warning (especially after having removed the VM ;)), so we opted for safer behavior. But you can remove the whole backup group for the VM at once.
 
So, I understand that to delete the backups of a deleted VM, it is an action that we must perform by hand.

Is this correct?
Yes. You could also write a script and run it by cron to search for any backups that are older than your highest backup retention and delete them. But gets complicated if you use differnent backup retentions like weekly+annualy
 
Hi,
Backups of removed VMs will not be removed automatically, because pruning will keep the same backups each time if nothing changes. Pruning does not depend on the current time, it only cares about the timestamps of the backups. See here for how pruning works exactly.

EDIT: Used the correct reason.
why not put it to the docu?
 
why not put it to the docu?
What do you mean exactly? I linked to the documentation, because it describes pruning in more detail.
 
What do you mean exactly? I linked to the documentation, because it describes pruning in more detail.
your info about deleted vms - i dont find a hint in the docu and this question is often posted here. u can save work if the docu give answer according frequently questions
 
Last edited:
  • Like
Reactions: misku
your info about deleted vms - i dont find a hint in the docu and this question is often posted here. u can save work if the docu give answer according frequently questions
@fiona I second this. I got to this thread after hours of googling. And am still a little wary of deleting one of my VMs because a forum post says it's safe and the backup won't ever be touched.

I find it difficult to get this information from the docs, or the pruning simular.

Would be easier to confirm with co-workers if there was another "Note" section that definitely confirms it:

"Note: Backups of deleted VMs will never be deleted."
Or:
"pruning will keep the same backups each time if nothing changes. Pruning does not depend on the current time, it only cares about the timestamps of the backups." (although not 100% clear to me what you mean with cares only about the timestamps)
https://pbs.proxmox.com/docs/maintenance.html#pruning

Would you consider making this more clear?
 
Last edited:
"Note: Backups of deleted VMs will never be deleted."
You can set the backup snapshot to protected, so it can't be deleted until you remove that protection flag again. Just keep in mind that syncing a backup snapshot will remove the protection on the pulling side.
 
You can set the backup snapshot to protected, so it can't be deleted until you remove that protection flag again. Just keep in mind that syncing a backup snapshot will remove the protection on the pulling side.
Thanks! That alleviates my worry a lot :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!