add: do not send if snapshots are equal

This commit is contained in:
timeshifter
2021-12-02 14:53:03 +01:00
parent 406278632a
commit 14509c439f
+2 -1
View File
@@ -50,7 +50,6 @@ def main():
# TODO --skip-pre-backup-scrub
# TODO --skip-post-backup-scrub
# TODO print time estimation while scrub is in progress
# skip send when sender and receiver snapshots are equal
class Manager:
@@ -259,6 +258,8 @@ class ZFS:
def send_incremental(old_snap: Snapshot, new_snap: Snapshot) -> Popen[str]:
if old_snap.dataset != new_snap.dataset:
raise ValueError(SAME_DATASET)
if old_snap == new_snap:
raise ValueError("Cannot send stream, snapshots are identical.")
print(f" {old_snap} -> {new_snap}")
sender = Popen(
[config.ZFS, "send", "-R", "-I", str(old_snap), str(new_snap)], stdout=PIPE