about summary refs log tree commit diff
path: root/hosts/common/server/backups/users.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hosts/common/server/backups/users.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/hosts/common/server/backups/users.nix b/hosts/common/server/backups/users.nix
new file mode 100644
index 0000000..d56f7fe
--- /dev/null
+++ b/hosts/common/server/backups/users.nix
@@ -0,0 +1,25 @@
+{ config, ... }:
+
+{
+
+  systemd.services.backups-maintenance-fcuny = {
+    Unit = {
+      Description = "maintenance for fcuny backups";
+      Documentation = "man:restic(1)";
+    };
+    Service = {
+      Type = "oneshot";
+      User = "restic";
+      ReadWritePaths = "/data/slow/backups/users/fcuny";
+      Environment = [
+        "RESTIC_REPOSITORY=/data/slow/backups/users/fcuny"
+        "RESTIC_PASSWORD_FILE="
+      ];
+      ExecStart = [
+        "${pkgs.restic}/bin/restic --verbose rebuild-index"
+        "${pkgs.restic}/bin/restic --verbose prune"
+        "${pkgs.restic}/bin/restic --verbose forget --prune --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 3"
+      ];
+    };
+  };
+}