Support
Forums

Re: replacement for Windows Home Server that copies WHS client backup

In which case Brian, you might like this for hot / consistent backups of KVM virtual machines using snapshots and Borg ..  [code]#!/bin/bashexport BACKUP_NAME=`date "+%A_%d_%B_%Y_%H_%M"`DOMAIN=$1IMAGE=`virsh domblklist ${DOMAIN}|grep vd...
In which case Brian, you might like this for hot / consistent backups of KVM virtual machines using snapshots and Borg ..  ;D
[code]#!/bin/bash

export BACKUP_NAME=`date "+%A_%d_%B_%Y_%H_%M"`
DOMAIN=$1
IMAGE=`virsh domblklist ${DOMAIN}|grep vda|xargs|cut -d" " -f2`
BACKUP=${IMAGE/qcow2/backup.qcow2}

if [[ "$IMAGE" == *".backup."* ]]
then
        echo "ERROR: snapshot already live - please fix!"
        exit -1
fi
if [ -f $BACKUP ]
then
        echo "ERROR: snapshot file already exists - please delete!"
 ...