]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add: pv status of vm backup
authorBastian Dehn <hhaalo@arcor.de>
Sat, 17 Feb 2018 10:14:45 +0000 (11:14 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 17 Feb 2018 10:14:45 +0000 (11:14 +0100)
backup

diff --git a/backup b/backup
index a7f726481ed96b97a69e356b71824d3386ec89d7..fe73247cbed4c273d4a8d46ea0b850b2ccb38679 100755 (executable)
--- a/backup
+++ b/backup
@@ -81,8 +81,12 @@ BackupVMDiscs() {
                elif [ "$DiskType" == "block" ]; then
                        local readonly DiskName=$(echo $Disk \
                                | sed 's/^\///' | sed 's/\//-/g')
+                       local readonly DiskSize=$(fdisk -l $Disk \
+                               | head -n 1 | awk -F "," '{print $2'} \
+                               | sed 's/[ \| bytes]//g')
 
-                       ssh $remoteLogin dd bs=1M if=$Disk | gzip -c \
+                       ssh $remoteLogin dd bs=1M if=$Disk \
+                               | pv -s $DiskSize | gzip -c \
                                | dd of=$backRemotePCPath/$DiskName.gz
                fi
        done