From f413aaf003a75cfe647235c0335302a1e908c21b Mon Sep 17 00:00:00 2001 From: sils Date: Sat, 13 Jan 2024 14:49:11 +0100 Subject: fix(sys/services/restic): also backup /srv --- sys/services/restic/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'sys') diff --git a/sys/services/restic/default.nix b/sys/services/restic/default.nix index c4ab7c3..a1bcdf6 100644 --- a/sys/services/restic/default.nix +++ b/sys/services/restic/default.nix @@ -4,21 +4,24 @@ ... }: { services.restic.backups = let - homeDir = "/srv/snapshots/home/sils"; - srvDir = "${homeDir}/srv"; + snapshotDir = "/srv/snapshots"; + homeDir = "${snapshotDir}/home"; boxUser = "u384702-sub1"; in { storagebox = { initialize = true; backupPrepareCommand = '' - [ -d /srv/snapshots/home ] && ${pkgs.btrfs-progs}/bin/btrfs subvolume delete /srv/snapshots/home; ${pkgs.btrfs-progs}/bin/btrfs subvolume snapshot -r /home /srv/snapshots/home; + [ -d /srv/snapshots/home ] && ${pkgs.btrfs-progs}/bin/btrfs subvolume delete /srv/snapshots/home; ${pkgs.btrfs-progs}/bin/btrfs subvolume snapshot -r /home /srv/snapshots/home; [ -d /srv/snapshots/srv ] && ${pkgs.btrfs-progs}/bin/btrfs subvolume delete /srv/snapshots/srv; ${pkgs.btrfs-progs}/bin/btrfs subvolume snapshot -r /srv /srv/snapshots/srv; ''; paths = [ - srvDir - "${homeDir}/schule" + snapshotDir + ]; + exclude = [ + "${homeDir}/sils/.cache" + "${homeDir}/sils/bulk" + "${homeDir}/sils/downloads" ]; extraBackupArgs = [ - "--exclude-if-present .nobackup" # Don't backup directory if it contains a file called ".nobackup" "--verbose" # Spam log ]; passwordFile = config.age.secrets.resticpass.path; -- cgit 1.4.1