Merge pull request #352 from phreaker0/clone-fallback

use ordinary replication if clone recreation fails
This commit is contained in:
Jim Salter 2019-03-29 12:00:00 -04:00 committed by GitHub
commit 12198180d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -447,6 +447,12 @@ sub syncdataset {
return 0;
}
system($synccmd) == 0 or do {
if (defined $origin) {
print "INFO: clone creation failed, trying ordinary replication as fallback\n";
syncdataset($sourcehost, $sourcefs, $targethost, $targetfs, undef, 1);
return 0;
}
warn "CRITICAL ERROR: $synccmd failed: $?";
if ($exitcode < 2) { $exitcode = 2; }
return 0;