From: Bastian Dehn Date: Sat, 17 Feb 2018 10:14:45 +0000 (+0100) Subject: add: pv status of vm backup X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=de97e33a08391e5231564180de4dea6cc880cc24;p=simple-backup.git add: pv status of vm backup --- diff --git a/backup b/backup index a7f7264..fe73247 100755 --- 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