add: do not send if snapshots are equal
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user