File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ if [[ $? -ne 0 ]]; then
48
48
donotify=1
49
49
fi
50
50
51
+ doprogress=0
52
+ which pv & > /dev/null
53
+ if [[ $? -ne 0 ]]; then
54
+ doprogress=1
55
+ fi
56
+
51
57
error () {
52
58
printf " ==> ERROR: %s\n" " $@ "
53
59
notify_error ' Error' ' Check journal for more information.'
@@ -459,8 +465,11 @@ for x in $selected_configs; do
459
465
460
466
if [[ -z " $old_num " ]]; then
461
467
printf " Sending first snapshot for '%s' configuration...\n" " $x " | tee $PIPE
462
- btrfs send " $new_snap " | $ssh btrfs receive " $backup_location " & > /dev/null
463
-
468
+ if [[ $doprogress -eq 0 ]]; then
469
+ btrfs send " $new_snap " | pv | $ssh btrfs receive " $backup_location " & > /dev/null
470
+ else
471
+ btrfs send " $new_snap " | $ssh btrfs receive " $backup_location " & > /dev/null
472
+ fi
464
473
else
465
474
466
475
printf " Sending incremental snapshot for '%s' configuration...\n" " $x " | tee $PIPE
@@ -469,7 +478,11 @@ for x in $selected_configs; do
469
478
# is an identical subvolume to the old snapshot at the receiving
470
479
# location where it can get its data. This helps speed up the transfer.
471
480
472
- btrfs send -c " $old_snap " " $new_snap " | $ssh btrfs receive " $backup_location "
481
+ if [[ $doprogress -eq 0 ]]; then
482
+ btrfs send -c " $old_snap " " $new_snap " | pv | $ssh btrfs receive " $backup_location "
483
+ else
484
+ btrfs send -c " $old_snap " " $new_snap " | $ssh btrfs receive " $backup_location "
485
+ fi
473
486
474
487
if [[ $keep == " yes" ]]; then
475
488
printf " Modifying data for old local snapshot for '%s' configuration...\n" " $x " | tee $PIPE
You can’t perform that action at this time.
0 commit comments