From 718a92694e822106c66bba8a106f042e1ffa6afe Mon Sep 17 00:00:00 2001 From: sefidel Date: Wed, 2 Aug 2023 10:07:19 +0900 Subject: feat(services/backup): setup auto prune --- modules/services/backup.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/services/backup.nix b/modules/services/backup.nix index a513d18..41d2329 100644 --- a/modules/services/backup.nix +++ b/modules/services/backup.nix @@ -59,6 +59,12 @@ in services.borgbackup.jobs.${cfg.name} = { inherit (cfg) paths exclude repo; + prune.keep = { + within = "1d"; # Keep all archives from the last day + daily = 7; + weekly = 4; + monthly = 3; + }; encryption.mode = "repokey-blake2"; encryption.passCommand = "cat ${cfg.repoKeyPath}"; -- cgit 1.4.1