Skip to content

Instantly share code, notes, and snippets.

View eopXD's full-sized avatar
🍢
Learn Learn Learn

Yueh-Ting (eop) Chen eopXD

🍢
Learn Learn Learn
View GitHub Profile
@eopXD
eopXD / vm-backup.sh
Created March 12, 2019 07:38 — forked from cabal95/vm-backup.sh
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1