Add 'extra_admin_email'. If set a summary e-mail will also be sent ti this address.

This commit is contained in:
Christoph 2018-03-11 23:11:14 +01:00
parent 59a4fabe49
commit b8522b35f9

View File

@ -16,6 +16,7 @@
content_type='Content-Type: text/plain;\n charset="utf-8"'
extra_admin_email=""
extra_error_email=""
## - These variables will be exportet from backup script (rcopy.sh)
@ -34,6 +35,9 @@
datum=`date +"%d.%m.%Y"`
echo -e "To:${admin_email}\n${content_type}\nSubject:Backup $company -- $datum\n$filesystem\n\ndisk label: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $admin_email
if [[ -n "$extra_admin_email" ]]; then
echo -e "To:${extra_admin_email}\n${content_type}\nSubject:Backup $company -- $datum\n$filesystem\n\ndisk label: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $extra_admin_email
fi
declare -i error=`grep -e"\[ERROR" $logFile | wc -l`
declare -i warning=`grep -e"\[WARN" $logFile | wc -l`