From 93f1fa77e0b6d6b630fbc48bd0311db63c4bb9a7 Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 23 Apr 2023 15:00:42 +0200 Subject: [PATCH] hosts/palladium: prevent borg filling up root partition --- hosts/palladium/backup-scripts.nix | 3 +++ hosts/palladium/configuration.nix | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/hosts/palladium/backup-scripts.nix b/hosts/palladium/backup-scripts.nix index b2a8f56..b2ccfdf 100644 --- a/hosts/palladium/backup-scripts.nix +++ b/hosts/palladium/backup-scripts.nix @@ -9,6 +9,9 @@ let ${pkgs.cryptsetup}/bin/cryptsetup luksOpen ''${DEVICE} external-drive mkdir -p /mnt/external-drive mount /dev/mapper/external-drive /mnt/external-drive + + mkdir -p /mnt/external-drive/clerie-backup + chown borg:borg -R /mnt/external-drive/clerie-backup ''; cb-unmount = pkgs.writeScriptBin "cb-unmount" '' diff --git a/hosts/palladium/configuration.nix b/hosts/palladium/configuration.nix index 20c24e1..41d9e16 100644 --- a/hosts/palladium/configuration.nix +++ b/hosts/palladium/configuration.nix @@ -41,6 +41,12 @@ }; }; + # Disable automatic directory creation for external-drive repo + # The directory gets created by the disk formatting script + # Correct permissons will be set right after mounting + # This prevents borg from filling up the root drive when no drive is mounted + systemd.services.borgbackup-repo-external-drive.enable = false; + clerie.monitoring = { enable = true; id = "206";