Skip to content

Instantly share code, notes, and snippets.

@lattera
Created August 27, 2015 15:46
Show Gist options
  • Save lattera/a3d5850e1415767e18e4 to your computer and use it in GitHub Desktop.
Save lattera/a3d5850e1415767e18e4 to your computer and use it in GitHub Desktop.
Mass export VirtualBox VMs
#!/bin/zsh
set -e
vms=("Jenkins" "GitLab" "Test VM")
date=$(date '+%F')
if [ ! -d ${date} ]; then
mkdir -p exports/${date}
fi
foreach vm in ${vms}; do
echo -n "Exporting ${vm}: "
VBoxManage export "${vm}" -o exports/${date}/${vm// /_}.ova
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment