nix/os/containers/backup: add common safety options to shell script
This commit is contained in:
parent
6d80ede6a5
commit
0ea2593e9c
1 changed files with 2 additions and 2 deletions
|
@ -126,6 +126,8 @@ in args // {
|
||||||
'';
|
'';
|
||||||
script = ''
|
script = ''
|
||||||
#! ${pkgs.bash}/bin/bash
|
#! ${pkgs.bash}/bin/bash
|
||||||
|
set -Eeuxo pipefail
|
||||||
|
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
export TIMESTAMP=$(date +"%Y%m%d.%H%M%S")
|
export TIMESTAMP=$(date +"%Y%m%d.%H%M%S")
|
||||||
|
|
||||||
|
@ -133,9 +135,7 @@ in args // {
|
||||||
for d in `ls -1 ${bkpSource}`; do
|
for d in `ls -1 ${bkpSource}`; do
|
||||||
echo Determining backup source size ${bkpSource}/$d...
|
echo Determining backup source size ${bkpSource}/$d...
|
||||||
du -hs ${bkpSource}/$d
|
du -hs ${bkpSource}/$d
|
||||||
set -x
|
|
||||||
rdup -x /dev/null ${bkpSource}/$d | rdedup -v -ttt --dir=${bkpDestination}/rdedup store $d-''${TIMESTAMP}
|
rdup -x /dev/null ${bkpSource}/$d | rdedup -v -ttt --dir=${bkpDestination}/rdedup store $d-''${TIMESTAMP}
|
||||||
set +x
|
|
||||||
done
|
done
|
||||||
sync
|
sync
|
||||||
echo Finished rdup/rdedup backup...
|
echo Finished rdup/rdedup backup...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue