fix: dont send if start == end

This commit is contained in:
timeshifter
2022-01-05 13:37:27 +01:00
parent aeb7cb00bd
commit 07d4946432
+8 -1
View File
@@ -66,6 +66,8 @@ class Manager:
stream = self._send_absolute(local_dataset)
else:
stream = self._send_incremental(local_dataset, remote_dataset)
if stream is None:
continue
ZFS.receive(stream, self._external_pool)
def _get_user_filtered_dataset_backup_map(self) -> _map_type:
@@ -97,12 +99,14 @@ class Manager:
def _send_incremental(
self, local_dataset: Dataset, remote_dataset: Dataset
) -> Popen:
) -> Popen | None:
"""Send incremental stream between two datasets to remote."""
start_snapshot = self._get_newest_common_snapshot_with_backup_tags(
local_dataset, remote_dataset
)
end_snapshot = self._get_newest_snapshot_with_backup_tag(local_dataset)
if start_snapshot == end_snapshot:
return None
stream = ZFS.send_incremental(start_snapshot, end_snapshot)
return stream
@@ -742,6 +746,9 @@ class Snapshot:
def __repr__(self):
return str(self._path)
def __eq__(self, other: ZFSPath):
return self._path == other._path
def newer_than(self, other: Snapshot) -> bool:
return self > other