From 6c155458d18c6eaa7931023a5c207b08da6b5303 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 14 Oct 2024 14:13:09 +0200 Subject: fix(services/backup): Fail the backup script, if a command fails --- modules/system/services/backup/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/system/services/backup') diff --git a/modules/system/services/backup/default.nix b/modules/system/services/backup/default.nix index e5f6e241..92700bf2 100644 --- a/modules/system/services/backup/default.nix +++ b/modules/system/services/backup/default.nix @@ -5,6 +5,8 @@ ... }: let backup-script = pkgs.writeShellScriptBin "backsnap" '' + set -xeu; + ${pkgs.util-linux}/bin/mount --mkdir "/dev/disk/by-uuid/${cfg.backupDiskUuid}" "/run/media/${cfg.backupDiskUuid}"; ${pkgs.snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; ${pkgs.util-linux}/bin/umount "/run/media/${cfg.backupDiskUuid}"; -- cgit 1.4.1