diff options
author | sils <sils@sils.li> | 2024-01-19 12:05:42 +0100 |
---|---|---|
committer | sils <sils@sils.li> | 2024-01-19 12:07:53 +0100 |
commit | e5ff84a9ade0d9018975b8ba990db4e1b224bfd4 (patch) | |
tree | 5665f73768073b26738e805e41860d7911c4555b | |
parent | chore(version): v0.20.1 (diff) | |
download | nixos-server-e5ff84a9ade0d9018975b8ba990db4e1b224bfd4.tar.gz nixos-server-e5ff84a9ade0d9018975b8ba990db4e1b224bfd4.zip |
fix(system/services/restic): create /srv/snapshots if non-existent
-rw-r--r-- | system/services/restic/default.nix | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/system/services/restic/default.nix b/system/services/restic/default.nix index 3af92a5..cfeaca3 100644 --- a/system/services/restic/default.nix +++ b/system/services/restic/default.nix @@ -13,6 +13,7 @@ backupPrepareCommand = '' ${pkgs.sudo}/bin/sudo -u ${postgresUser} ${pkgs.postgresql}/bin/pg_dumpall --clean --if-exists --quote-all-identifiers > /srv/db_backup.sql + [ -d /srv/snapshots ] || ${pkgs.btrfs-progs}/bin/btrfs subvolume create /srv/snapshots; [ -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; |