From f9bfc4e1061a0593c4221fb6c6eb99a3c28c8d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Sch=C3=A4ferdiek?= Date: Tue, 17 Sep 2019 21:31:57 +0200 Subject: [PATCH] Add hostname to mails --- usr/local/bin/borgwrapper | 3 ++- usr/local/bin/resticwrapper | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/local/bin/borgwrapper b/usr/local/bin/borgwrapper index 8ccf505..00340d1 100755 --- a/usr/local/bin/borgwrapper +++ b/usr/local/bin/borgwrapper @@ -188,7 +188,8 @@ backup() { ${BORG_BINARY} ${BORGWRAPPER_BORG_INFO_PARAMS} ${BORGWRAPPER_BACKUP_REPOSITORY}${BORGWRAPPER_BACKUP_NAME}::${BORGWRAPPER_BACKUP_TIMESTAMP_FORMAT} >> ${BORGWRAPPER_BACKUP_LOG_FILE}; if [ "${BORGWRAPPER_BACKUP_NOTIFY_VIA_MAIL}" = true ]; then - cat ${BORGWRAPPER_BACKUP_LOG_FILE}|mailx -Ssendwait -s "[borgwrapper ${BORGWRAPPER_BACKUP_NAME}]" ${BORGWRAPPER_BACKUP_NOTIFY_MAIL_ADDRESS}; + local hostname=$(hostname) + cat ${BORGWRAPPER_BACKUP_LOG_FILE}|mailx -Ssendwait -s "[borgwrapper on ${hostname} for ${BORGWRAPPER_BACKUP_NAME}]" ${BORGWRAPPER_BACKUP_NOTIFY_MAIL_ADDRESS}; fi fi diff --git a/usr/local/bin/resticwrapper b/usr/local/bin/resticwrapper index 36b4ad7..dd2f972 100755 --- a/usr/local/bin/resticwrapper +++ b/usr/local/bin/resticwrapper @@ -192,7 +192,8 @@ backup() { ${RESTIC_BINARY} ${RESTICWRAPPER_RESTIC_INFO_PARAMS} >> ${RESTICWRAPPER_BACKUP_LOG_FILE}; if [ "${RESTICWRAPPER_BACKUP_NOTIFY_VIA_MAIL}" = true ]; then - cat ${RESTICWRAPPER_BACKUP_LOG_FILE}|mailx -Ssendwait -s "[resticwrapper ${RESTICWRAPPER_BACKUP_NAME}]" ${RESTICWRAPPER_BACKUP_NOTIFY_MAIL_ADDRESS}; + local hostname=$(hostname) + cat ${RESTICWRAPPER_BACKUP_LOG_FILE}|mailx -Ssendwait -s "[resticwrapper on ${hostname} for ${RESTICWRAPPER_BACKUP_NAME}]" ${RESTICWRAPPER_BACKUP_NOTIFY_MAIL_ADDRESS}; fi fi