diff --git a/salt/states/files/borg.sh b/salt/states/files/borg.sh index d6d6962..4bb7539 100755 --- a/salt/states/files/borg.sh +++ b/salt/states/files/borg.sh @@ -10,6 +10,12 @@ fi source "$HOME/.borgbackup.env" + +# some helpers and error handling: +info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; } +trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM + + info "Starting backup" # Backup the most important directories into an archive named after