From 33ebaa92113bfff2182c49db31537fd846f1ba98 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 23 Feb 2022 09:34:00 +0100 Subject: zfssnap: smoother frequency transition --- modules/zfssnap/default.nix | 3 +++ modules/zfssnap/zfssnap.py | 3 +++ 2 files changed, 6 insertions(+) (limited to 'modules') diff --git a/modules/zfssnap/default.nix b/modules/zfssnap/default.nix index 1dbd7e17..451097b4 100644 --- a/modules/zfssnap/default.nix +++ b/modules/zfssnap/default.nix @@ -44,7 +44,10 @@ in { keep = { within = "15m"; "5m" = "48"; + "15m" = "32"; hourly = "48"; + "4h" = "24"; + "12h" = "12"; daily = "62"; monthly = "-1"; }; diff --git a/modules/zfssnap/zfssnap.py b/modules/zfssnap/zfssnap.py index d524f5db..857244f1 100644 --- a/modules/zfssnap/zfssnap.py +++ b/modules/zfssnap/zfssnap.py @@ -115,7 +115,10 @@ def prune(config, dry_run, keep_newest): ("secondly", lambda t: t.strftime('%Y-%m-%d %H:%M:%S')), ("minutely", lambda t: t.strftime('%Y-%m-%d %H:%M')), ("5m", lambda t: (t.strftime('%Y-%m-%d %H'), floor(t.minute / 5) * 5)), + ("15m", lambda t: (t.strftime('%Y-%m-%d %H'), floor(t.minute / 15) * 15)), ("hourly", lambda t: t.strftime('%Y-%m-%d %H')), + ("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')), ("weekly", lambda t: t.strftime('%G-%V')), ("monthly", lambda t: t.strftime('%Y-%m')), -- cgit v1.2.3