# or this to ask an external program to supply the passphrase:
#export BORG_PASSCOMMAND='pass show backup'
+# Custom keyfile support
+if [ "<%= @encryption %>" == "keyfile" ] && [ ! -z "<%= @keyfile %>" ]; then
+ if [ ! -e "<%= @keyfile %>" ]; then
+ fatal "Keyfile not found: <%= @keyfile %>. Please create it manually."
+ fi
+
+ export BORG_KEY_FILE="/root/.borg/hydra/key"
+fi
+
# some helpers and error handling:
#info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
trap 'info $( date ) Backup interrupted >&2; exit 2' INT TERM