From 63979973b2ed5da4c7c1884c43f428041cdcde84 Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Wed, 2 May 2018 00:15:14 +0200 Subject: [PATCH] if syncoid is instructed to skip snapshot creation it shouldn't attempt to prune existing ones --- syncoid | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/syncoid b/syncoid index e63b68c..999ee79 100755 --- a/syncoid +++ b/syncoid @@ -387,9 +387,11 @@ sub syncdataset { } } - # prune obsolete sync snaps on source and target. - pruneoldsyncsnaps($sourcehost,$sourcefs,$newsyncsnap,$sourceisroot,keys %{ $snaps{'source'}}); - pruneoldsyncsnaps($targethost,$targetfs,$newsyncsnap,$targetisroot,keys %{ $snaps{'target'}}); + if (!defined $args{'no-sync-snap'}) { + # prune obsolete sync snaps on source and target (only if this run created ones). + pruneoldsyncsnaps($sourcehost,$sourcefs,$newsyncsnap,$sourceisroot,keys %{ $snaps{'source'}}); + pruneoldsyncsnaps($targethost,$targetfs,$newsyncsnap,$targetisroot,keys %{ $snaps{'target'}}); + } } # end syncdataset()