Schedule jobs for boot, or start from CLI

aarcane

Active Member
Jul 28, 2015
35
3
33
I'm looking to run a second PBS server separate from my main, and have it just power up in the middle of the night (I've got this working), then immediately kick off a sync job, then a verify, then a prune/GC, then, if the start up time was the scheduled time, also automatically shut down when all three are done. I have been reading the documentation, and I see how to create these items from CLI, list them, and even delete them. However, I don't see any option to schedule them for startup or boot or poweron or anything helpful, and I also don't see any way to launch them directly from the cli. I would expect something like proxmox-backup-manager run-job jobid or proxmox-backup-manager syncjob run jobid. Has anybody managed to figure this out, or can you direct me to the documentation for how to trigger these scheduled jobs either at boot, or from the command line?
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
8,640
1,126
174
34
Vienna
if you start up your server and the schedules say that the jobs would have run while it was down, they will start immediately.
in your case, it would suggest something different though. i think it would be better if those things run in sequence rather than together.

for that you can use the cli, but instead of using jobs, simply call
Code:
proxmox-backup-manager pull <options> # like a sync but not a job
proxmox-backup-manager verify <options>
proxmox-backup-manager garbage-collection start <options>
put those in a script and fire them off via cron/systemd timers/etc
this way you can also run a 'shutdown' or similar at the end of the script and it should do what you wanted

alternatively you can use the api directly with e.g. curl or similar, but then you'd have to do ticket/api token management/etc.

you can of course also open a feature request for starting the various jobs on the cli here: https://bugzilla.proxmox.com

hope that helps
 

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 your own in 60 seconds.

Buy now!