User Tools

Site Tools


Using snapshots

This is a simple script to create a snapshot of a Virtualbox virtual machine running as a specific user. You can run this script using the RunBefore attribute in the Job resource.

It doesnt do any sanity checks, it takes a username and a vm name and creates a snapshot for the vm given. It does not check existance of the user, existance of the vm, space availability, etc.


# Pass the user running the VM as paramater 1
# Pass the VM name running by the user as parameter 2

# if you need to adjust paths for the binaries called, adjust the variables ''su'' and ''vboxm'' accordingly
snapname="bacula-$(date '+%Y%m%d-%H%M%S')"

$su "$user" -c "$vboxm snapshot \"$vm\" take \"$snapname\""

exit 0
application_specific_backups/virtualbox_on_linux_hosts.txt · Last modified: 2014/10/05 01:56 (external edit)