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