vzdump hook script to mount USB drive?

tin

Renowned Member
Aug 14, 2010
109
2
83
Northwest NSW, Australia
I know I can do this myself, but why reinvent the wheel?
Does anyone already have a basic hook script that simply mounts a device at "job-start" and unmounts it at "job-end"?

Also, while I'm asking, is there a why to abort a backup from the hook scripts is errors are detected (such as the USB disk not mounting)?
 
Locate the script on the usb drive so it doesn't run if it's not mounted?
 
It's all good - I created a script over the last hour or so, and it seems to work OK. I'll post it here after I finish testing and cleaning it up in case anyone else wants to do this.

Edit: And to answer my own question in the first post - vzdump aborts the backup if it gets a non-zero exit from the hook script, so I just had it exit with 1 if the mount fails.