Skip to content

Instantly share code, notes, and snippets.

@wintermute000
wintermute000 / vm-backup.sh
Last active April 8, 2018 09:28 — 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"
OWNER="$4"
GROUP="$5"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then