From: Bastian Dehn Date: Wed, 14 Feb 2018 16:54:26 +0000 (+0100) Subject: add: vm device type X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=603f6772b46c9a26a8d705107d7e22b56b5f65b7;p=simple-backup.git add: vm device type --- diff --git a/backup b/backup index 3fd1898..8264e4c 100755 --- a/backup +++ b/backup @@ -62,18 +62,25 @@ BackupVMDiscs() { | grep disk \ | awk '{print $4}') local logFile="" + local DiskType="" for Disk in $Disks; do printf "Disk %s von %s wird gesichert\n\n" "$Disk" "$VM" + DiskType=$(ssh $remoteLogin virsh vol-info $Disk \ + | grep Type | awk '{print $2}') logFile="$backRemotePCPath/backup-$(echo $Disk \ | sed 's/\//-/g').log" - rsync --archive --verbose --sparse --acls --hard-links \ - --relative --progress --human-readable \ - --log-file=$logFile \ - $hardlinkopt \ - $remoteLogin:$Disk $backRemotePCPath + if [ "$DiskType" == "file" ]; then + rsync --archive --verbose --sparse --acls --hard-links \ + --relative --progress --human-readable \ + --log-file=$logFile \ + $hardlinkopt \ + $remoteLogin:$Disk $backRemotePCPath + elif [ "$DiskType" == "block" ]; then + # TODO implement lvm backup + fi done }