Created
July 20, 2022 17:13
-
-
Save aboron/593235bb93b7dbf60efb944f5b49838e to your computer and use it in GitHub Desktop.
quick smartos backup for LX and OS zones (not KVM)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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