vzdump script for specific backup job possible?

Jan 2, 2021
17
0
6
40
I'm trying to find the simplest method to backup a few VM's to my Google Drive.

I found the hook script https://github.com/TheRealAlexV/proxmox-vzbackup-rclone that utilizes rclone. Seems doable. But the thing I can't figure out is if it's possible to only call this script for a specific backup job. I'd like to have a separate job that can backup just the few VMs I need offsite backed up, maybe once a week or month, thinking DR for a few critical VMs. Then let my nightly local backup run for all VM's. But looking around at the /etc/pve/jobs.cfg, and /etc/vzdump.conf I don't see how I can specify the job. Although it looks like in the jobs.cfg it does assign what looks like a guid to the job so maybe that can be used?
 
it's possible to only call this script for a specific backup job.
The script will always be called by all backup jobs. What you can do is write some conditions inside the hook script to only do stuff for specific VMIDs, guest types, target storages or nodes.
Or you write your own script triggered by cron/systemd and let it call the vzdump command to do the backups of the VMs without using a backup job. The vzdump command also allows you to specify a path to a hook script.
 
Last edited:
Hi,
you can set the hookscript for a single job too, but only via CLI/API. Get the ID of the job in /etc/pve/jobs.cfg and use
pvesh set /cluster/backup/backup-<ID> --script /path/to/executable/script. It's actually the same for other settings too. In /etc/vzdump.conf are the node-wide defaults, and each job can have more specific settings.
 
  • Like
Reactions: Dunuin
Hi,
you can set the hookscript for a single job too, but only via CLI/API. Get the ID of the job in /etc/pve/jobs.cfg and use
pvesh set /cluster/backup/backup-<ID> --script /path/to/executable/script. It's actually the same for other settings too. In /etc/vzdump.conf are the node-wide defaults, and each job can have more specific settings.
That's very interesting, that should do what I need. I might need to chase some documentation on this.
 

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!