mirror of https://github.com/digint/btrbk
btrbk: bugfix: print all errors if send/receive fails
If stream_compress is enabled and compress command is not found, we now print "command not found".pull/245/head
parent
9aeaf2b15c
commit
de57efff82
17
btrbk
17
btrbk
|
@ -1422,17 +1422,12 @@ sub btrfs_send_receive($$$$)
|
||||||
$ret = $err; # print the errors below
|
$ret = $err; # print the errors below
|
||||||
}
|
}
|
||||||
if(defined($ret)) {
|
if(defined($ret)) {
|
||||||
# NOTE: if "btrfs send" fails, "btrfs receive" returns 0! so we need to parse the output...
|
# NOTE: btrfs-progs < 4.11: if "btrfs send" fails, "btrfs receive" returns 0! so we need to parse the output for "ERROR:" lines:
|
||||||
foreach(split("\n", $ret)) {
|
my @ret_lines = split("\n", $ret);
|
||||||
if(/^ERROR: /) {
|
$send_receive_error = 1 if(grep /^ERROR: /, @ret_lines);
|
||||||
ERROR $';
|
foreach(@ret_lines) {
|
||||||
$send_receive_error = 1;
|
if(/^WARNING: / || $send_receive_error) {
|
||||||
}
|
WARN "[send/receive] (send=$snapshot_path, receive=$target_path) $_";
|
||||||
elsif(/^WARNING: /) {
|
|
||||||
WARN "[send/receive] (send=$snapshot_path, receive=$target_path) $'";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
WARN "[send/receive] (send=$snapshot_path, receive=$target_path) $_" if($send_receive_error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue