[SOLVED] vzdump hook script and PBS

bockhold

Active Member
Jan 13, 2018
26
3
43
41
Hello everybody,

is there a way inside a vzdump hook script (written in Bash) to recognize that the backup target is a Proxmox Backup Server?

Currently I automatically backup to a local storage and have a hook script defined in /etc/vzdump.conf via "script: ..." which copies the backup files via SSH to another machine. This copying is not necessary with a (remote) PBS, of course. For a testing period I would like to have both backup mechanisms in parallel therefore disabling the hook script totally is no good option currently.

Thanks!
 
You could use the provided environment variables to distinguish, e.g.:

* $STOREID: destination storage name, match on this to detect a PBS target
* $TARGET (e.g. "vm/115/2021-05-18T14:25:32Z"): PBS targets will be in format "vm/vmid/timestamp", regular backups will have a valid filesystem path
 
Thank you very much, @Stefan_R , I tried something along
Code:
[...]
local tarfile="${TARGET}"
[...]
if [ -f "${tarfile}" ]; then
    scp ...
fi
[...]
now and it works as expected! Great! :-)
 

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!