about summary refs log tree commit diff
path: root/hosts/common
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-03-07 07:35:07 -0800
committerFranck Cuny <franck@fcuny.net>2022-03-07 07:35:07 -0800
commit78674f6a567367ce48204e38491a4817adc66b37 (patch)
tree21b17d2a731ee7f9e70ed7d27bd973cdddb989d7 /hosts/common
parentunifi: backup the data to the local reo (diff)
downloadworld-78674f6a567367ce48204e38491a4817adc66b37.tar.gz
prometheus: backup the data directory
Diffstat (limited to 'hosts/common')
-rw-r--r--hosts/common/server/prometheus.nix14
1 files changed, 14 insertions, 0 deletions
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" ];
+    };
+  };
 }