]> git.somenet.org - ctf/pub/adminscripts.git/blob - vbox_snapshot.sh
GITOLITE.txt
[ctf/pub/adminscripts.git] / vbox_snapshot.sh
1 #!/bin/bash
2 #
3 # Copyright 2015 by Jan Vales <jan@jvales.net> (Someone <someone@somenet.org>)
4 # send me your changes. credit author(s). do not publish. share alike.
5 # to be done: find a suitable licence text.
6 #
7 # Script to snapshot VMs.
8 #
9
10 if [[ $1 == "" ]] ; then
11         echo "No <VM-Name> given. (Use ALL for all vms)"
12         exit 1
13 fi
14
15 if [[ $1 == "ALL" ]] ; then
16         for i in vmGW vmSVC vmVULN ; do
17                 echo "VM -${i}-"
18                 VBoxManage snapshot ${i} take "${i}_autoSnap_" --live --uniquename "Timestamp"
19         done
20 else
21         VBoxManage snapshot ${1} take "${1}_autoSnap_" --live --uniquename "Timestamp"
22 fi
23