Backup Question (vzdump)

shatter

Member
Nov 27, 2009
74
0
6
Hi *,

for backup purposes I use the Proxmox backup functionality. It basicially stores the VM in TAR file.

After the such a backup of the VM I would need to run my own shell script - to save data files which belong to the VM but are not within the shut down VMs file system (they are mounted with mount bind from the VM host upon VM start).

So, is there a possiblility to run a individual shell script within Proxmox's backup function?

Perfect working sequence would be:
* shut down the VM
* backup the VM with vzdump
* run the individual shell script if one is defined
* start the vm again

Joachim
 
Yes
man qm & vzdump it's easyly possible !

create backup.sh

#!/bin/sh
veid=$1
qm stop $veid
vzdump --dumpdir /space/backup --snapshot $veid
qm start $veid

^^
 
create backup.sh

#!/bin/sh
veid=$1
qm stop $veid
vzdump --dumpdir /space/backup --snapshot $veid
qm start $veid


Now my Followup:

  1. My VM is not a KVM machine ... but that would just mean using "vzctl" instead of "qm", right?
  2. VZDUMP only may run if the qm/vzctl-stop command was successful. So: does vzctl/qm issue a zero return value upon successful completion?
  3. Your solution has to be run outside the Proxmox backup function and scheduled by CRON, does it? So: is there a Way to use the Proxmox backup function with an additions shell script?

Thanx,

Joachim