Skip to content

Instantly share code, notes, and snippets.

@samba
Created December 26, 2016 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samba/2786e7f2d21ddac1d9a4c66b9df51a31 to your computer and use it in GitHub Desktop.
Save samba/2786e7f2d21ddac1d9a4c66b9df51a31 to your computer and use it in GitHub Desktop.
VirtualBox Snapshot Kit
#!/bin/sh
export MACHINE_NAME="test machine"
export DATE=`date +"%Y-%m-%d %H:%M:%S"`
take_snapshot () {
while read vmuuid; do
VBoxManage snapshot "${vmuuid}" take "Snapshot ${DATE}"
done
}
# List machines
VBoxManage list vms | grep "${MACHINE_NAME}" | grep -oE '\{[a-z0-9-]+\}' | take_snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment