From 2af0a1d88f73c8cd05ed071f47b5d3cdc6223051 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 23 Feb 2022 10:03:05 +0100 Subject: zfssnap: retain weekly --- modules/zfssnap/default.nix | 2 ++ modules/zfssnap/zfssnap.py | 1 + 2 files changed, 3 insertions(+) (limited to 'modules') diff --git a/modules/zfssnap/default.nix b/modules/zfssnap/default.nix index 451097b4..d1080e8a 100644 --- a/modules/zfssnap/default.nix +++ b/modules/zfssnap/default.nix @@ -49,6 +49,8 @@ in { "4h" = "24"; "12h" = "12"; daily = "62"; + halfweekly = "32"; + weekly = "24"; monthly = "-1"; }; }; diff --git a/modules/zfssnap/zfssnap.py b/modules/zfssnap/zfssnap.py index 857244f1..6d9bc6de 100644 --- a/modules/zfssnap/zfssnap.py +++ b/modules/zfssnap/zfssnap.py @@ -120,6 +120,7 @@ def prune(config, dry_run, keep_newest): ("4h", lambda t: (t.strftime('%Y-%m-%d'), floor(t.hour / 4) * 4)), ("12h", lambda t: (t.strftime('%Y-%m-%d'), floor(t.hour / 12) * 12)), ("daily", lambda t: t.strftime('%Y-%m-%d')), + ("halfweekly", lambda t: (t.strftime('%G-%V'), floor(int(t.strftime('%u')) / 4) * 4)), ("weekly", lambda t: t.strftime('%G-%V')), ("monthly", lambda t: t.strftime('%Y-%m')), ("yearly", lambda t: t.strftime('%Y')), -- cgit v1.2.3