implemented option for keeping sync snaps
This commit is contained in:
parent
e6c5aa052e
commit
d77cfdf4c7
10
syncoid
10
syncoid
|
@ -25,7 +25,7 @@ GetOptions(\%args, "no-command-checks", "monitor-version", "compress=s", "dumpsn
|
|||
"source-bwlimit=s", "target-bwlimit=s", "sshkey=s", "sshport=i", "sshcipher|c=s", "sshoption|o=s@",
|
||||
"debug", "quiet", "no-stream", "no-sync-snap", "no-resume", "exclude=s@", "skip-parent", "identifier=s",
|
||||
"no-clone-handling", "no-privilege-elevation", "force-delete", "no-clone-rollback", "no-rollback",
|
||||
"create-bookmark", "pv-options=s" => \$pvoptions,
|
||||
"create-bookmark", "pv-options=s" => \$pvoptions, "keep-sync-snap",
|
||||
"mbuffer-size=s" => \$mbuffer_size) or pod2usage(2);
|
||||
|
||||
my %compressargs = %{compressargset($args{'compress'} || 'default')}; # Can't be done with GetOptions arg, as default still needs to be set
|
||||
|
@ -837,9 +837,11 @@ sub syncdataset {
|
|||
};
|
||||
}
|
||||
} else {
|
||||
# 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'}});
|
||||
if (!defined $args{'keep-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()
|
||||
|
|
Loading…
Reference in New Issue