nix/os/containers/backup: add common safety options to shell script

This commit is contained in:
steveej 2020-03-15 09:55:59 +01:00
parent 6d80ede6a5
commit 0ea2593e9c

View file

@ -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...