Adjust subject format on borgwrapper send, add more examples on how to configure borgwrapper

This commit is contained in:
Alexander Schäferdiek 2020-01-07 08:09:29 +01:00
parent d4d124a513
commit ca9b168d17
4 changed files with 29 additions and 3 deletions

View file

@ -168,7 +168,7 @@ backup() {
${BORG_BINARY} ${BORGWRAPPER_BORG_CHECK_PARAMS} ${BORGWRAPPER_BACKUP_REPOSITORY}${BORGWRAPPER_BACKUP_NAME};
touch ${BORGWRAPPER_BACKUP_CHECK_FILE}
fi
fi
fi
# prune
if [ "${BORGWRAPPER_BACKUP_PRUNE}" = true ]; then
@ -189,7 +189,7 @@ backup() {
if [ "${BORGWRAPPER_BACKUP_NOTIFY_VIA_MAIL}" = true ]; then
local hostname=$(hostname)
cat ${BORGWRAPPER_BACKUP_LOG_FILE}|mailx -Ssendwait -s "[borgwrapper on ${hostname} for ${BORGWRAPPER_BACKUP_NAME}]" ${BORGWRAPPER_BACKUP_NOTIFY_MAIL_ADDRESS};
cat ${BORGWRAPPER_BACKUP_LOG_FILE}|mailx -Ssendwait -s "[borgwrapper on ${hostname}] ${BORGWRAPPER_BACKUP_REPOSITORY}${BORGWRAPPER_BACKUP_NAME}::${BORGWRAPPER_BACKUP_TIMESTAMP_FORMAT} finished" ${BORGWRAPPER_BACKUP_NOTIFY_MAIL_ADDRESS};
fi
fi
@ -218,4 +218,4 @@ case "$COMMAND" in
usage;
exit 1
;;
esac
esac

View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
#BORG_RSH="ssh -i /path/to/another/rsa_key/.ssh/backup-key"
BORGWRAPPER_BACKUP_NAME="backup-name"
BORGWRAPPER_BACKUP_REPOSITORY="ssh://user@remoteHost:Port/./"
BORGWRAPPER_BACKUP_FILES=(\
'/etc/' \
'$HOME/' \
)
BORGWRAPPER_BACKUP_ENCRYPTION="repokey-blake2"
BORGWRAPPER_BACKUP_PASSWORD="secretPassword"
BORGWRAPPER_BORG_CREATE_PARAMS="create -v -s -p --exclude-from /path/to/.borgwrapper.exclude"
BORGWRAPPER_BACKUP_LOG=true
BORGWRAPPER_BACKUP_NOTIFY_VIA_MAIL=true
BORGWRAPPER_BACKUP_NOTIFY_MAIL_ADDRESS="alias@domain.tld"
borgwrapper_pre_backup() {
return;
}
borgwrapper_post_backup() {
return;
}

View file

@ -0,0 +1,4 @@
/proc/**
/var/log/**
*/build/**
*/node_modules/**