From 1a46a65c00d6a818083e209c39670b89fe6e9e2a Mon Sep 17 00:00:00 2001 From: macronova Date: Sat, 9 Aug 2025 13:57:06 -0500 Subject: [PATCH] Update backup policy --- linux/quasar/zfs.nix | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/linux/quasar/zfs.nix b/linux/quasar/zfs.nix index c182cde..91fabac 100644 --- a/linux/quasar/zfs.nix +++ b/linux/quasar/zfs.nix @@ -31,7 +31,7 @@ jobs = let archiveBaseName = "archive"; backupBaseName = "backup"; - pushConfig = name: grid: { + pushConfig = name: snapshot: grid: { type = "push"; name = "push-${name}"; connect = { @@ -41,12 +41,13 @@ }; filesystems."zactive/main/home" = true; send.encrypted = true; - snapshotting.type = "manual"; + snapshotting = snapshot; pruning = { keep_sender = [ { - type = "regex"; + type = "grid"; regex = "^zrepl-.*"; + grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "24x1h" "7x1d" "4x1w"]; } ]; keep_receiver = [ @@ -73,27 +74,12 @@ recv.placeholder.encryption = "off"; }; in [ - { - type = "snap"; - name = "snapshot"; - filesystems."zactive/main/home" = true; - snapshotting = { - type = "periodic"; - prefix = "zrepl-"; - interval = "1h"; - }; - pruning = { - keep = [ - { - type = "grid"; - regex = "^zrepl-.*"; - grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "24x1h" "7x1d" "4x1w"]; - } - ]; - }; - } - (pushConfig archiveBaseName ["1x1h(keep=all)" "30x1d" "52x1w"]) - (pushConfig backupBaseName ["8x13w"]) + (pushConfig archiveBaseName { + type = "periodic"; + prefix = "zrepl-"; + interval = "1h"; + } ["1x1h(keep=all)" "30x1d" "52x1w"]) + (pushConfig backupBaseName {type = "manual";} ["8x13w"]) (sinkConfig archiveBaseName "zarchive/snapshot") (sinkConfig backupBaseName "zbackup/snapshot") ];