added the trap and info function

This commit is contained in:
Jonas Forsberg 2020-08-10 14:24:19 +02:00
parent e5f5246010
commit 42600fff64
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9

View File

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