From 0ea2593e9c69e2a49f06425ec4e5a7abfd386545 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Sun, 15 Mar 2020 09:55:59 +0100 Subject: [PATCH] nix/os/containers/backup: add common safety options to shell script --- nix/os/containers/backup.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/os/containers/backup.nix b/nix/os/containers/backup.nix index 426979b..8b9a3d3 100644 --- a/nix/os/containers/backup.nix +++ b/nix/os/containers/backup.nix @@ -126,6 +126,8 @@ in args // { ''; script = '' #! ${pkgs.bash}/bin/bash + set -Eeuxo pipefail + export RUST_BACKTRACE=1 export TIMESTAMP=$(date +"%Y%m%d.%H%M%S") @@ -133,9 +135,7 @@ in args // { for d in `ls -1 ${bkpSource}`; do echo Determining backup source size ${bkpSource}/$d... du -hs ${bkpSource}/$d - set -x rdup -x /dev/null ${bkpSource}/$d | rdedup -v -ttt --dir=${bkpDestination}/rdedup store $d-''${TIMESTAMP} - set +x done sync echo Finished rdup/rdedup backup...