mirror of https://github.com/digint/btrbk
btrbk: skip target metadata test if send/receive has errors
parent
961f96833a
commit
4c4afe776d
9
btrbk
9
btrbk
|
@ -1146,7 +1146,6 @@ sub btrfs_send_receive($$$$;@)
|
||||||
$send_receive_error = 1;
|
$send_receive_error = 1;
|
||||||
$ret = $err; # print the errors below
|
$ret = $err; # print the errors below
|
||||||
}
|
}
|
||||||
# TODO: This might not be needed anymore. check if we can remove this.
|
|
||||||
if(defined($ret)) {
|
if(defined($ret)) {
|
||||||
# NOTE: if "btrfs send" fails, "btrfs receive" returns 0! so we need to parse the output...
|
# NOTE: if "btrfs send" fails, "btrfs receive" returns 0! so we need to parse the output...
|
||||||
foreach(split("\n", $ret)) {
|
foreach(split("\n", $ret)) {
|
||||||
|
@ -1163,7 +1162,7 @@ sub btrfs_send_receive($$$$;@)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unless($dryrun) {
|
unless($send_receive_error) {
|
||||||
# Read in target subvolume metadata (btrfs subvolume show):
|
# Read in target subvolume metadata (btrfs subvolume show):
|
||||||
# Double checking the output increases robustness against exotic
|
# Double checking the output increases robustness against exotic
|
||||||
# revisions of external commands (btrfs-progs, pv, xz, lz4, ...).
|
# revisions of external commands (btrfs-progs, pv, xz, lz4, ...).
|
||||||
|
@ -1176,6 +1175,10 @@ sub btrfs_send_receive($$$$;@)
|
||||||
# error message, having the effect that silently no subvolume is
|
# error message, having the effect that silently no subvolume is
|
||||||
# created if any command in @cmd_pipe fail.
|
# created if any command in @cmd_pipe fail.
|
||||||
|
|
||||||
|
if($dryrun) {
|
||||||
|
INFO "[send/receive] (dryrun, skip) checking target metadata: $vol_received->{PRINT}";
|
||||||
|
}
|
||||||
|
else {
|
||||||
INFO "[send/receive] checking target metadata: $vol_received->{PRINT}";
|
INFO "[send/receive] checking target metadata: $vol_received->{PRINT}";
|
||||||
my $detail = btrfs_subvolume_show($vol_received);
|
my $detail = btrfs_subvolume_show($vol_received);
|
||||||
if(defined($detail)) {
|
if(defined($detail)) {
|
||||||
|
@ -1203,8 +1206,6 @@ sub btrfs_send_receive($$$$;@)
|
||||||
$send_receive_error = 1;
|
$send_receive_error = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
INFO "[send/receive] (dryrun, skip) checking target metadata: $vol_received->{PRINT}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
end_transaction("send-receive", ($dryrun ? "DRYRUN" : ($send_receive_error ? "ERROR" : "success")));
|
end_transaction("send-receive", ($dryrun ? "DRYRUN" : ($send_receive_error ? "ERROR" : "success")));
|
||||||
|
|
Loading…
Reference in New Issue