Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
psy0rz committed Oct 11, 2024
1 parent 4fbcc87 commit 3919fe0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_externalfailures.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_incremental_resumeabort(self):

# --test try again, should abort old resume
with mocktime("20101111000002"):
self.assertFalse(ZfsAutobackup("test test_target1 --no-progress --verbose --test".split(" ")).run())
self.assertFalse(ZfsAutobackup("test test_target1 --no-progress --verbose --test --debug".split(" ")).run())

# try again, should abort old resume
with mocktime("20101111000002"):
Expand Down
7 changes: 5 additions & 2 deletions zfs_autobackup/ZfsDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,15 +692,16 @@ def is_changed_ours(self, min_changed_bytes=1):

def bookmark(self, tag):
"""Bookmark this snapshot, and return the bookmark. If the bookmark already exist, it returns it."""
# NOTE: we use the tag to add the target_path GUID, so that we can have multiple bookmarks for the same snapshot, but for different target. This is to make sure you can send a backup to two locations, without them interfering with eachothers bookmarks.
# NOTE: we use the tag to add the target_path GUID, so that we can have multiple bookmarks for the same snapshot, but for different targets.
# This is to make sure you can send a backup to two locations, without them interfering with eachothers bookmarks.

if not self.is_snapshot:
raise (Exception("Can only bookmark a snapshot!"))

bookmark_name = self.prefix + "#" + self.tagless_suffix + self.zfs_node.tag_seperator + tag

# does this exact bookmark (including tag) already exists?
existing_bookmark = self.find_exact_bookmark(bookmark_name)
existing_bookmark = self.parent.find_exact_bookmark(bookmark_name)
if existing_bookmark is not None:
return existing_bookmark

Expand Down Expand Up @@ -1423,7 +1424,9 @@ def sync_snapshots(self, target_dataset, features, show_progress, filter_propert
# FIXME: met bookmarks kan de huidige snapshot na send ook meteen weg
# FIXME: klopt niet, nu haalt ie altijd bookmark weg? wat als we naar andere target willen senden (zoals in test_encryption.py)
if prev_source_snapshot_bookmark and (
# its an obsolete snapshot?
prev_source_snapshot_bookmark in source_obsoletes or (
# its our bookmark?
prev_source_snapshot_bookmark.is_bookmark and prev_source_snapshot_bookmark.tag == bookmark_tag)):
prev_source_snapshot_bookmark.destroy()

Expand Down

0 comments on commit 3919fe0

Please sign in to comment.