Skip to content

Instantly share code, notes, and snippets.

View tixxdz's full-sized avatar
👽

Djalal Harouni tixxdz

👽
View GitHub Profile
@tixxdz
tixxdz / vm-backup.sh
Created January 23, 2017 10:21 — 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