From 78674f6a567367ce48204e38491a4817adc66b37 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 7 Mar 2022 07:35:07 -0800 Subject: prometheus: backup the data directory --- hosts/common/server/prometheus.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hosts/common/server') diff --git a/hosts/common/server/prometheus.nix b/hosts/common/server/prometheus.nix index d939a5a..d097cff 100644 --- a/hosts/common/server/prometheus.nix +++ b/hosts/common/server/prometheus.nix @@ -52,4 +52,18 @@ in { } ]; }; + + age.secrets.restic-repo-systems.file = + ../../../secrets/restic/repo-systems.age; + + services.restic.backups = { + prometheus = { + paths = [ "/var/lib/prometheus2" ]; + repository = "/data/slow/backups/systems"; + passwordFile = config.age.secrets.restic-repo-systems.path; + initialize = true; + extraBackupArgs = [ "--tag prometheus" ]; + pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" ]; + }; + }; } -- cgit 1.4.1