Any way to add/remove a VM ID to /etc/cron.d/vzdump through CLI?

Tuxington

Member
Jan 20, 2020
7
0
6
Hello,

I'm trying to figure out if there's a CLI command that will allow me to edit /etc/cron.d/vzdump at will, without use of the GUI?

Is there anything in place that will "reset" /etc/cron.d/vzdump automatically on Proxmox's end? I want to edit the line using ansible to add/remove VM's I create/destroy. Would editing it using ansible update the GUI as well?

I grabbed a HAR while editing the GUI and saw the put request info. Should this be done through the API?

Thanks
 
Would editing it using ansible update the GUI as well?

You should edit the /etc/pve/vzdump instead the /etc/cron.d/vzdump.
As long the syntax is correct Proxmox VE has no problem with it.

Should this be done through the API?
The API would be the safer way.
 
Is there anything in place that will "reset" /etc/cron.d/vzdump automatically on Proxmox's end? I want to edit the line using ansible to add/remove VM's I create/destroy. Would editing it using ansible update the GUI as well?

With Proxmox VE 6.0 you can add a whole pool as a backup target. You could leverage this by creating such a backup job and then just specify that pool on VM/CT create - it will then be included automatically in the backup as long as the VM/CT exists.
 
You should edit the /etc/pve/vzdump instead the /etc/cron.d/vzdump.
As long the syntax is correct Proxmox VE has no problem with it.


The API would be the safer way.

Thank you! i wasn't aware that that file existed. I probably glossed over it thinking the path was for cron.d. I will give it a shot using the API first, but I will admit it's not my strongest skill! I did see some documentation about the API though, so it may not be as bad as I'm making it out to be in my head.

With Proxmox VE 6.0 you can add a whole pool as a backup target. You could leverage this by creating such a backup job and then just specify that pool on VM/CT create - it will then be included automatically in the backup as long as the VM/CT exists.

Sadly I'm still running 5.4. I didn't realize there was an upgrade, so I will have to plan that. My setup also isn't that complicated, I just have a couple of VM's(and possibly more in the future) that I don't need backed up, and prefer to maintain a curated list. I will have to look into that feature though once I hit 6.0 as that sounds way easier to reach my end result.

Thank you both very much!
 
So after upgrading to 6.0 I found the "Exclude Selected VMs" backup option. Works for my situation! Not sure if this was a new(ish) feature that I never learned about or didn't even think about it when I initially setup my backups however long ago.

Leaving a note about this in case someone else stumbles across this post with a similar idea to what I had, but may not actually need to create a more complicated solution.
 

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!