From f23d277c5b33a546ab7f8e216ac38fc7193ed6ac Mon Sep 17 00:00:00 2001 From: timeshifter Date: Thu, 3 Feb 2022 19:51:14 +0100 Subject: [PATCH] workaround cleaning stale snapshots --- zfs_backup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zfs_backup.py b/zfs_backup.py index 0d32def..ac0dea1 100755 --- a/zfs_backup.py +++ b/zfs_backup.py @@ -679,6 +679,7 @@ class ExternalPool(Pool): exit(EXIT_ERROR) def clean_old_snapshots(self) -> None: + return # this seems to be broken TODO print("Cleaning old snapshots") for dataset in self.datasets: dataset.clean_old_snapshots() @@ -721,7 +722,7 @@ class Dataset: for interval, number in config.keep_snapshots_per_interval.items(): self._clean_old_snapshots_for_interval(interval, number) - def _clean_old_snapshots_for_interval(self, interval: str, max_count: int) -> None: + def _clean_old_snapshots_for_interval(self, interval: str, max_count: int) -> None: # TODO I assume the regex matches across different datasets, which it shouldn't regex = _get_regex_matching_snapshots_with_tags([config.snapshot_tag, interval]) snapshots = [ snapshot for snapshot in self.snapshots if snapshot.matches_regex(regex) @@ -752,7 +753,7 @@ class Snapshot: def __repr__(self): return str(self._path) - def __eq__(self, other: ZFSPath): + def __eq__(self, other: Snapshot): return self._path == other._path def newer_than(self, other: Snapshot) -> bool: