]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add: dd sicherung blockdevice
authorBastian Dehn <hhaalo@arcor.de>
Thu, 15 Feb 2018 16:24:57 +0000 (17:24 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 15 Feb 2018 16:24:57 +0000 (17:24 +0100)
backup

diff --git a/backup b/backup
index 8264e4c8a148e0c66ccce0882da6ceb6626c0bf2..a7f726481ed96b97a69e356b71824d3386ec89d7 100755 (executable)
--- a/backup
+++ b/backup
@@ -79,7 +79,11 @@ BackupVMDiscs() {
                                $hardlinkopt \
                                $remoteLogin:$Disk $backRemotePCPath
                elif [ "$DiskType" == "block" ]; then
-                       # TODO implement lvm backup
+                       local readonly DiskName=$(echo $Disk \
+                               | sed 's/^\///' | sed 's/\//-/g')
+
+                       ssh $remoteLogin dd bs=1M if=$Disk | gzip -c \
+                               | dd of=$backRemotePCPath/$DiskName.gz
                fi
        done
 }