diff --git a/zfs-backup.py b/zfs-backup.py index dc1a686..e416fdc 100755 --- a/zfs-backup.py +++ b/zfs-backup.py @@ -52,6 +52,7 @@ def main(): # TODO print time estimation while scrub is in progress # skip send when sender and receiver snapshots are equal + class Manager: def __init__(self, local_pool: Pool, external_pool: ExternalPool): self._local_pool = local_pool @@ -111,7 +112,9 @@ class Manager: return dataset @classmethod - def _get_last_common_snapshot(cls, local_dataset: Dataset, remote_dataset: Dataset) -> Snapshot: + def _get_last_common_snapshot( + cls, local_dataset: Dataset, remote_dataset: Dataset + ) -> Snapshot: common_snapshots = [ local_snap for local_snap in list(cls._find_snapshots_with_backup_tag(local_dataset)) @@ -280,6 +283,7 @@ class ZFS: if wait_for_finish: # TODO make Ctrl-c interrupt this run_command([config.ZPOOL, "wait", "-t", "scrub", pool]) + # TODO raise error if pool is not healthy @@ -444,7 +448,9 @@ class Dataset: for snapshot in old_snapshots: snapshot.destroy() - def _get_n_oldest_snapshots(self, snapshots: list[Snapshot], count: int) -> list[Snapshot]: + def _get_n_oldest_snapshots( + self, snapshots: list[Snapshot], count: int + ) -> list[Snapshot]: snapshots.sort() return snapshots[:count]