diff --git a/conf/logrotate.conf.sample b/conf/logrotate.conf.sample index d44dd0f..b48300e 100644 --- a/conf/logrotate.conf.sample +++ b/conf/logrotate.conf.sample @@ -22,7 +22,7 @@ #admin_email="argus@oopen.de" #from_address="root@`hostname -f`" #company="Warenform INET" - #logFile=/backup/log/rsync.log + #logFile=/backup/log/rcopy.log #label durations_top="\nBackup durations of the certain hosts:\n" @@ -30,11 +30,15 @@ send=`cat $logFile` - datum=`date +"%d.%m.%Y"` + datum="$(date +"%d.%m.%Y")" - echo -e "To:${admin_email}\n${content_type}\nSubject:Backup $company -- $datum\n$filesystem\n\nBackup resource / Label: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $admin_email + subject="Backup $company -- $datum" + subject_utf8="$(echo "$subject" | iconv -t UTF8)" + subject_utf8_encoded="=?utf-8?B?$(echo $subject_utf8 | base64 --wrap=0)?=" + + echo -e "To:${admin_email}\n${content_type}\nSubject:${subject_utf8_encoded}\n$filesystem\n\nBackup resource / 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\nBackup resource / Labe: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $extra_admin_email + echo -e "To:${extra_admin_email}\n${content_type}\nSubject:${subject_utf8_encoded}\n$filesystem\n\nBackup resource / Labe: $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` @@ -51,9 +55,13 @@ msg="${msg_top}\n${msg_body_01}\n${msg_body_02}" - echo -e "To:${admin_email}\n${content_type}\nSubject:Backup Errors $company -- $datum\n${msg}" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $admin_email + subject="Backup Errors $company -- $datum" + subject_utf8="$(echo "$subject" | iconv -t UTF8)" + subject_utf8_encoded="=?utf-8?B?$(echo $subject_utf8 | base64 --wrap=0)?=" + + echo -e "To:${admin_email}\n${content_type}\nSubject:${subject_utf8_encoded}\n${msg}" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $admin_email if [ "X$extra_error_email" != "X" ]; then - echo -e "To:${extra_error_email}\n${content_type}\nSubject:Backup Errors $company -- $datum\n${msg}" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $extra_error_email + echo -e "To:${extra_error_email}\n${content_type}\nSubject:${subject_utf8_encoded}\n${msg}" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $extra_error_email fi fi