mirror of https://github.com/jimsalterjrs/sanoid
capture the stderr of zfs send command in the case of a resumed replication where the send size can't be estimated (in which case pv is not working anyway, so we can break the interactivitiy)
This commit is contained in:
parent
22fe41cb11
commit
56f97b5bd2
15
syncoid
15
syncoid
|
|
@ -526,9 +526,18 @@ sub syncdataset {
|
||||||
if (!$quiet) { print "Resuming interrupted zfs send/receive from $sourcefs to $targetfs (~ $disp_pvsize remaining):\n"; }
|
if (!$quiet) { print "Resuming interrupted zfs send/receive from $sourcefs to $targetfs (~ $disp_pvsize remaining):\n"; }
|
||||||
if ($debug) { print "DEBUG: $synccmd\n"; }
|
if ($debug) { print "DEBUG: $synccmd\n"; }
|
||||||
|
|
||||||
($stdout, $exit) = tee_stdout {
|
if ($pvsize == 0) {
|
||||||
system("$synccmd")
|
# we need to capture the error of zfs send, this will render pv useless but in this case
|
||||||
};
|
# it doesn't matter because we don't know the estimated send size (probably because
|
||||||
|
# the initial snapshot used for resumed send doesn't exist anymore)
|
||||||
|
($stdout, $exit) = tee_stderr {
|
||||||
|
system("$synccmd")
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
($stdout, $exit) = tee_stdout {
|
||||||
|
system("$synccmd")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
$exit == 0 or do {
|
$exit == 0 or do {
|
||||||
if ($stdout =~ /\Qused in the initial send no longer exists\E/) {
|
if ($stdout =~ /\Qused in the initial send no longer exists\E/) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue