How to create a (PBS) backup schedule via CLI?

linum

Renowned Member
Sep 25, 2011
99
3
73
I'm searching an official way to create an entry in /etc/pve/vzdump.cron to add a PBS backup job. I already use pvesm to create the PBS server via cli but I can't find any documentation how to add something to vzdump.cron.
 
vzdump.cron recently got switched to a new scheduler/config file (configured via /etc/pve/jobs.cfg), so depending on your version that might be what you want to look at.

AFAIK it's not exposed directly on the CLI, but you can use pvesh or any other API client:
/cluster/backup (GET for index, POST for creating a new job)
/cluster/backup/{id} (GET for details of job definition, PUT for updating, DELETE for removing a job)
 
Ok, thanks for the hint. But it seems that just using the GUI doesn't create the jobs.cfg file if an vzdump.cron exisits. Just checked. With pve-manager/7.1-10/6ddebafe (running kernel: 5.15.19-1-pve) running.
 
it should try to update/move jobs from cron to jobs.cfg when you update the job.. what did you try exactly? creating a new job?
 
The first time just uncheck und checked the "Enable" option but without leaving the dialog. Seconds try is with leaving the dialog and now the jobs.cfg was created and the old entry was removed from vzdump.cron.
 
yeah, most of our 'edit' dialogues are smart enough to realize if there are no changes at all and don't make the update call in that case ;)
 
yeah, most of our 'edit' dialogues are smart enough to realize if there are no changes at all and don't make the update call in that case ;)
And that's usally a very good thing.

BTW: Just noticed, while I'm working on several ansible playbooks, how powerful the cli is. Good job!
 
and most of the things in the CLI (and all the things in the web interface) are available over the API ;)
 

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!