Skip to content

Instantly share code, notes, and snippets.

@aboron
Created July 20, 2022 17:13
Show Gist options
  • Save aboron/593235bb93b7dbf60efb944f5b49838e to your computer and use it in GitHub Desktop.
Save aboron/593235bb93b7dbf60efb944f5b49838e to your computer and use it in GitHub Desktop.
quick smartos backup for LX and OS zones (not KVM)
#!/usr/bin/bash
if [ "$#" -ne 1 ]; then
echo " *** Illegal number of parameters"
echo
echo "Usage: vm-backup <UUID>"
echo
echo "Note: Backups will dump into the current directory"
echo
exit 0
fi
UUID=$1
vmadm get ${UUID} > ${UUID}.json
zfs snapshot zones/${UUID}@decom
zfs send -p zones/${UUID}@decom | pbzip2 > ${UUID}.zfs.bz
zfs destroy zones/${UUID}@decom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment