if syncoid is instructed to skip snapshot creation it shouldn't attempt to prune existing ones

This commit is contained in:
Christoph Klaffl 2018-05-02 00:15:14 +02:00
parent 24845bd10c
commit 63979973b2
No known key found for this signature in database
GPG Key ID: FC1C525C2A47CC28
1 changed files with 5 additions and 3 deletions

View File

@ -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()