Debug scripts with TRACE envvar

This commit is contained in:
Erik Westrup
2023-06-02 22:32:09 +02:00
parent 2406f078ef
commit a870259eb2
3 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -8,8 +8,9 @@
# $ source $PREFIX/etc/default.env.sh
# $ restic_backup.sh
# Exit on error, unset var, pipe failure
set -eo pipefail
set -o errexit
set -o pipefail
[[ "${TRACE-0}" =~ ^1|t|y|true|yes$ ]] && set -o xtrace
# Clean up lock if we are killed.
# If killed by systemd, like $(systemctl stop restic), then it kills the whole cgroup and all it's subprocesses.