summary refs log tree commit diff stats
path: root/system/services/restic
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--system/services/restic/default.nix1
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;