Skip to content

Commit

Permalink
fix #217
Browse files Browse the repository at this point in the history
  • Loading branch information
psy0rz committed Sep 26, 2023
1 parent bdc156e commit de898fc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions zfs_autobackup/ZfsDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,6 @@ def sync_snapshots(self, target_dataset, features, show_progress, filter_propert
# check if we can resume
resume_token = self._validate_resume_token(target_dataset, start_snapshot)

# rollback target to latest?
if rollback:
target_dataset.rollback()


(active_filter_properties, active_set_properties) = self.get_allowed_properties(filter_properties, set_properties)
Expand All @@ -1121,12 +1118,18 @@ def sync_snapshots(self, target_dataset, features, show_progress, filter_propert
# now actually transfer the snapshots
prev_source_snapshot = common_snapshot
source_snapshot = start_snapshot
do_rollback=rollback
while source_snapshot:
target_snapshot = target_dataset.find_snapshot(source_snapshot) # still virtual

# does target actually want it?
if target_snapshot not in target_obsoletes:

#do the rollback, one time at first transfer
if do_rollback:
target_dataset.rollback()
do_rollback = False

source_snapshot.transfer_snapshot(target_snapshot, features=features,
prev_snapshot=prev_source_snapshot, show_progress=show_progress,
filter_properties=active_filter_properties,
Expand Down

0 comments on commit de898fc

Please sign in to comment.