diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-02-23 09:34:00 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-02-23 09:34:00 +0100 |
commit | 33ebaa92113bfff2182c49db31537fd846f1ba98 (patch) | |
tree | 2b9d19edfba9b34e6cca8134d31a5f030b5247c5 /modules | |
parent | 8d26c87292538f6f2b6ecc9e186926922d878cce (diff) | |
download | nixos-33ebaa92113bfff2182c49db31537fd846f1ba98.tar nixos-33ebaa92113bfff2182c49db31537fd846f1ba98.tar.gz nixos-33ebaa92113bfff2182c49db31537fd846f1ba98.tar.bz2 nixos-33ebaa92113bfff2182c49db31537fd846f1ba98.tar.xz nixos-33ebaa92113bfff2182c49db31537fd846f1ba98.zip |
zfssnap: smoother frequency transition
Diffstat (limited to 'modules')
-rw-r--r-- | modules/zfssnap/default.nix | 3 | ||||
-rw-r--r-- | modules/zfssnap/zfssnap.py | 3 |
2 files changed, 6 insertions, 0 deletions
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 { | |||
44 | keep = { | 44 | keep = { |
45 | within = "15m"; | 45 | within = "15m"; |
46 | "5m" = "48"; | 46 | "5m" = "48"; |
47 | "15m" = "32"; | ||
47 | hourly = "48"; | 48 | hourly = "48"; |
49 | "4h" = "24"; | ||
50 | "12h" = "12"; | ||
48 | daily = "62"; | 51 | daily = "62"; |
49 | monthly = "-1"; | 52 | monthly = "-1"; |
50 | }; | 53 | }; |
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): | |||
115 | ("secondly", lambda t: t.strftime('%Y-%m-%d %H:%M:%S')), | 115 | ("secondly", lambda t: t.strftime('%Y-%m-%d %H:%M:%S')), |
116 | ("minutely", lambda t: t.strftime('%Y-%m-%d %H:%M')), | 116 | ("minutely", lambda t: t.strftime('%Y-%m-%d %H:%M')), |
117 | ("5m", lambda t: (t.strftime('%Y-%m-%d %H'), floor(t.minute / 5) * 5)), | 117 | ("5m", lambda t: (t.strftime('%Y-%m-%d %H'), floor(t.minute / 5) * 5)), |
118 | ("15m", lambda t: (t.strftime('%Y-%m-%d %H'), floor(t.minute / 15) * 15)), | ||
118 | ("hourly", lambda t: t.strftime('%Y-%m-%d %H')), | 119 | ("hourly", lambda t: t.strftime('%Y-%m-%d %H')), |
120 | ("4h", lambda t: (t.strftime('%Y-%m-%d'), floor(t.hour / 4) * 4)), | ||
121 | ("12h", lambda t: (t.strftime('%Y-%m-%d'), floor(t.hour / 12) * 12)), | ||
119 | ("daily", lambda t: t.strftime('%Y-%m-%d')), | 122 | ("daily", lambda t: t.strftime('%Y-%m-%d')), |
120 | ("weekly", lambda t: t.strftime('%G-%V')), | 123 | ("weekly", lambda t: t.strftime('%G-%V')), |
121 | ("monthly", lambda t: t.strftime('%Y-%m')), | 124 | ("monthly", lambda t: t.strftime('%Y-%m')), |