From 49d4a82a43a12d62858a83a26fd86d27986a9fb8 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 7 Mar 2022 07:13:38 -0800 Subject: unifi: backup the data to the local reo --- hosts/common/server/unifi.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hosts/common') diff --git a/hosts/common/server/unifi.nix b/hosts/common/server/unifi.nix index ed1f82e..cf38137 100644 --- a/hosts/common/server/unifi.nix +++ b/hosts/common/server/unifi.nix @@ -62,5 +62,19 @@ in { Type = "oneshot"; }; }; + + age.secrets.restic-repo-systems.file = + ../../../secrets/restic/repo-systems.age; + + services.restic.backups = { + unifi = { + paths = [ "/var/lib/unifi" ]; + repository = "/data/slow/backups/systems"; + passwordFile = config.age.secrets.restic-repo-systems.path; + initialize = true; + extraBackupArgs = [ "--tag unifi" ]; + pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" ]; + }; + }; }; } -- cgit 1.4.1