if bookmark creation fails use guid bases suffix based fallback name
This commit is contained in:
parent
99b439e383
commit
a748b41f09
20
syncoid
20
syncoid
|
@ -689,9 +689,23 @@ sub syncdataset {
|
|||
}
|
||||
if ($debug) { print "DEBUG: $bookmarkcmd\n"; }
|
||||
system($bookmarkcmd) == 0 or do {
|
||||
warn "CRITICAL ERROR: $bookmarkcmd failed: $?";
|
||||
if ($exitcode < 2) { $exitcode = 2; }
|
||||
return 0;
|
||||
# fallback: assume nameing conflict and try again with guid based suffix
|
||||
my $guid = $snaps{'source'}{$newsyncsnap}{'guid'};
|
||||
$guid = substr($guid, 0, 6);
|
||||
|
||||
if (!$quiet) { print "INFO: bookmark creation failed, retrying with guid based suffix ($guid)...\n"; }
|
||||
|
||||
if ($sourcehost ne '') {
|
||||
$bookmarkcmd = "$sshcmd $sourcehost " . escapeshellparam("$sourcesudocmd $zfscmd bookmark $sourcefsescaped\@$newsyncsnapescaped $sourcefsescaped\#$newsyncsnapescaped$guid");
|
||||
} else {
|
||||
$bookmarkcmd = "$sourcesudocmd $zfscmd bookmark $sourcefsescaped\@$newsyncsnapescaped $sourcefsescaped\#$newsyncsnapescaped$guid";
|
||||
}
|
||||
if ($debug) { print "DEBUG: $bookmarkcmd\n"; }
|
||||
system($bookmarkcmd) == 0 or do {
|
||||
warn "CRITICAL ERROR: $bookmarkcmd failed: $?";
|
||||
if ($exitcode < 2) { $exitcode = 2; }
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue