From 0808575874875ee202d4a035744db75ca9d54162 Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Tue, 13 Sep 2022 17:13:01 +0200 Subject: [PATCH] syncoid should exit with an error if the specified src dataset doesn't exist (and only skip child datasets which vanished) --- syncoid | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/syncoid b/syncoid index ec6ae9d..167fc58 100755 --- a/syncoid +++ b/syncoid @@ -141,6 +141,8 @@ my %avail = checkcommands(); my %snaps; my $exitcode = 0; +my $replicationCount = 0; + ## break here to call replication individually so that we ## ## can loop across children separately, for recursive ## ## replication ## @@ -297,7 +299,7 @@ sub syncdataset { if (!defined $sync) { # zfs already printed the corresponding error - if ($error =~ /\bdataset does not exist\b/) { + if ($error =~ /\bdataset does not exist\b/ && $replicationCount > 0) { if (!$quiet) { print "WARN Skipping dataset (dataset no longer exists): $sourcefs...\n"; } return 0; } @@ -811,6 +813,8 @@ sub syncdataset { } } + $replicationCount++; + if (defined $args{'no-sync-snap'}) { if (defined $args{'create-bookmark'}) { my $bookmarkcmd;