|
|
|
@ -584,8 +584,16 @@ sub run_dump{ |
|
|
|
|
$cmd .= " | $dumpcmd 2>/dev/null"; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
print "\nStarting dump of $source to $dest\n\n" if ($opts{debug}); |
|
|
|
|
$cmd = "$opts{ionice} dd if=$source bs=$opts{blocksize} | $opts{nice} $opts{compcmd} > $dest 2>/dev/null"; |
|
|
|
|
if ( -f $source && $opts{compcmd} eq 'cat' ){ |
|
|
|
|
# Source disk is a regular file and no compression was selected |
|
|
|
|
# thus use cp instead of dd to preserve possible sparsity |
|
|
|
|
print "\nStarting dump of $source to $dest using cp -a\n\n" if ($opts{debug}); |
|
|
|
|
$cmd = "$opts{ionice} cp -a $source $dest"; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
print "\nStarting dump of $source to $dest using dd\n\n" if ($opts{debug}); |
|
|
|
|
$cmd = "$opts{ionice} dd if=$source bs=$opts{blocksize} | $opts{nice} $opts{compcmd} > $dest 2>/dev/null"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
unless( system("$cmd") == 0 ){ |
|
|
|
|