Is there a way to run a script before/after a Job

mike2012

Renowned Member
Apr 29, 2015
42
1
73
Is there a way to run a script before/after a job like Prune / Garbage collect / sync / ...
 
just for completeness:
added a comment to your request as this would also be useful for me (waking the PBS machine before job)
Best regards,
Otto
 
Has anyone figured out anything for this?

I'm in the same boat, but I need to dial a VPN connection prior to a sync job. (and ideally take it down after the job).
 
HI,I had a similar need, here's how I did it:
- defined a job (in my case a verify job) not scheduled directly by PBS (disabled)
- created a shell script:

#!/bin/bash
# 1. mount share where remote datastore resides
mount /mnt/pbsaws
# 2. run verify job by his ID (taken from PBS console)
proxmox-backup-manager verify-job run v-xxxxxxxx-yyyy
#3. unmount share
umount /mnt/pbsaws

the script is executed via crontab every week on Sunday
It should be easy for you to adapt the script to suit your needs.

I hope I was helpful,
Greetings
 

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!