Skip to content

Instantly share code, notes, and snippets.

View berlinguyinca's full-sized avatar

Gert Wohlgemuth berlinguyinca

  • davis,california,usa
View GitHub Profile
@berlinguyinca
berlinguyinca / vm-backup.sh
Created February 28, 2019 04:01 — 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