diff options
author | sils <sils@sils.li> | 2024-01-13 14:49:11 +0100 |
---|---|---|
committer | sils <sils@sils.li> | 2024-01-13 14:49:11 +0100 |
commit | f413aaf003a75cfe647235c0335302a1e908c21b (patch) | |
tree | b8775af62bd53b9a11247ea09aef68171c28fb68 /sys | |
parent | feat(sys/networking): add network (diff) | |
download | nix-config-f413aaf003a75cfe647235c0335302a1e908c21b.tar.gz nix-config-f413aaf003a75cfe647235c0335302a1e908c21b.zip |
fix(sys/services/restic): also backup /srv
Diffstat (limited to 'sys')
-rw-r--r-- | sys/services/restic/default.nix | 15 |
1 files changed, 9 insertions, 6 deletions
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; |