Backup jobs that are triggered by PBS

Elbows

New Member
Jul 8, 2023
2
1
3
I have one PVE with four VMs that runs 24/7. PBS is installed on a VM in a TrueNAS server that is not running 24/7 - it's on my media NAS so is running some evenings.

How to do I have PBS trigger backups of the VMs when it is running, rather than having backup jobs on PVE that fail if the PBS host is not running?

I'm hoping this is possible. I'd like to trigger the backup 'pull' jobs once per day on start up of PBS.
Maybe it's possible to create a datacenter level backup job on PVE and have PBS trigger a 'run now'?

Many thanks.
 
Hmm there are several ways...
- Cron Script which checks the pbs reachability and run the Backup Job
- Systemd Service with script that connect from pbs to pve over ssh to start the backup job or a script which start the job over API
 
I like the setup! I'm doing this, and not in my living room, with real gear.
My capacity systems are virtual PBS running directly on TrueNAS, so it has direct access to the storage.
I sync backups to these virtual systems from the primary bare-metal-ssd-lotsa-ram systems that actually do the backups.

...

Um ... I'd second the cron script suggestion. You can set it to start on boot or at some specific time (maybe when you aren't watching movies.)
Run the cron on the PBS server, and have it reach out to the PVE host to trigger the backup.
That way it only ever triggers when the PBS VM is up.
I'm not sure what the script is gonna look like, but I'm positive you can ssh and run a vzdump, so it's scriptable.

...

I just tested this.
ssh from PBS to the PVE host and then ...
vzdump --all --mode snapshot --storage datastore1

I'm watching it work from a shell session on the PBS console.
It's dumping onto the PBS, where it should.
That's not a perfect solution yet, but this is very scriptable.
Look here: https://pve.proxmox.com/pve-docs-6/chapter-vzdump.html#_examples

I wish i could get it to trigger a preconfigured backup job. Not sure how to do that.
There was an old system called vzdump.cron that was apparently easy to poke at.
The new system uses pvescheduler and /etc/pve/jobs.cfg. It's less accessible.
 
Last edited:
Thanks for the ideas guys :)
I think I'll try writing a script on pbs to call with cron @reboot. Even running a backup everyday should be ok once I get my backup retention right.

The pbs store on TrueNAS is a RAIDZ1 4x1TB SSD pool and my media is on a different (spinning rust) pool so it'll be a good test of throughput from the NAS (a repurposed QNAP TVS1282).
 
  • Like
Reactions: tcabernoch

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!