From de97e33a08391e5231564180de4dea6cc880cc24 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 17 Feb 2018 11:14:45 +0100 Subject: [PATCH] add: pv status of vm backup --- backup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.39.5