don't die on some critical sync errors, but continue to replicate all the other datasets.
after all is done exit with an error code
This commit is contained in:
parent
7c68ef5e8f
commit
63eec4994c
21
syncoid
21
syncoid
|
@ -298,8 +298,11 @@ sub syncdataset {
|
|||
if ($exitcode < 1) { $exitcode = 1; }
|
||||
return 0;
|
||||
}
|
||||
system($synccmd) == 0
|
||||
or die "CRITICAL ERROR: $synccmd failed: $?";
|
||||
system($synccmd) == 0 or do {
|
||||
warn "CRITICAL ERROR: $synccmd failed: $?";
|
||||
if ($exitcode < 2) { $exitcode = 2; }
|
||||
return 0;
|
||||
};
|
||||
|
||||
# now do an -I to the new sync snapshot, assuming there were any snapshots
|
||||
# other than the new sync snapshot to begin with, of course - and that we
|
||||
|
@ -359,8 +362,11 @@ sub syncdataset {
|
|||
|
||||
if (!$quiet) { print "Resuming interrupted zfs send/receive from $sourcefs to $targetfs (~ $disp_pvsize remaining):\n"; }
|
||||
if ($debug) { print "DEBUG: $synccmd\n"; }
|
||||
system("$synccmd") == 0
|
||||
or die "CRITICAL ERROR: $synccmd failed: $?";
|
||||
system("$synccmd") == 0 or do {
|
||||
warn "CRITICAL ERROR: $synccmd failed: $?";
|
||||
if ($exitcode < 2) { $exitcode = 2; }
|
||||
return 0;
|
||||
};
|
||||
|
||||
# a resumed transfer will only be done to the next snapshot,
|
||||
# so do an normal sync cycle
|
||||
|
@ -416,8 +422,11 @@ sub syncdataset {
|
|||
|
||||
if (!$quiet) { print "Sending incremental $sourcefs\@$matchingsnap ... $newsyncsnap (~ $disp_pvsize):\n"; }
|
||||
if ($debug) { print "DEBUG: $synccmd\n"; }
|
||||
system("$synccmd") == 0
|
||||
or die "CRITICAL ERROR: $synccmd failed: $?";
|
||||
system("$synccmd") == 0 or do {
|
||||
warn "CRITICAL ERROR: $synccmd failed: $?";
|
||||
if ($exitcode < 2) { $exitcode = 2; }
|
||||
return 0;
|
||||
};
|
||||
|
||||
# restore original readonly value to target after sync complete
|
||||
# dyking this functionality out for the time being due to buggy mount/unmount behavior
|
||||
|
|
Loading…
Reference in New Issue