feat: support email notification when backup succeeds and fails

This commit is contained in:
ttionya
2020-06-14 01:59:29 +08:00
parent 299fe93b9d
commit 89e45af55a
6 changed files with 141 additions and 3 deletions
+16
View File
@@ -9,6 +9,22 @@ if [[ "$1" == "rclone" ]]; then
exit 0
fi
# mailx test
if [[ "$1" == "mail" ]]; then
MAIL_SMTP_ENABLE="TRUE"
MAIL_DEBUG="TRUE"
if [[ -n "$2" ]]; then
MAIL_TO="$2"
fi
init_env
send_mail "BitwardenRS Backup Test" "Your SMTP looks configured correctly."
exit 0
fi
function configure_cron() {
echo "${CRON} sh /app/backup.sh > /dev/stdout" >> /etc/crontabs/root
}