Per Falko's recommendation I have installed pflogsumm on my SUSE 10.3 Postfix based mail server, The SUSE implementation of logrotate adds a date stamp to the compressed log file name. As in maillog-20080314.bz2. I would like to keep this format for the other logs generated. The example postfix_report.sh I have has the file name for the compressed mail log hard coded (mail.log.0.bz2). Since the compressed SUSE mail log name changes, My script postfix_report does not work. I can run the postfix_report script manually, if I go in and edit the script and put in the current compressed mail log file name. pflogsumm is generating the proper info and passing it to postfix for delivery OK. Is there a way to... A: modify the postfix_report.sh to add the date variable to the mail log file name it accesses? B: Create an additional cron job creating a specific mail.log.0 file to be used by the postfix_report.sh and pflogsumm? This level of scripting is beyond my limited ability ! Also: Are there any links out there to an explanation of how the SUSE implementation of logrotate actually works? Thanks in advance pto44128
Instead of using Code: pflogsumm /var/log/maillog.0 | formail -c -I"Subject: Mail Statistics" -I"From: pflogsumm@localhost" -I"To: [email protected]" -I"Received: from www.example.com ([192.168.0.100])" | sendmail [email protected] in the /usr/local/sbin/postfix_report.sh script, you can try this: Code: [COLOR="Red"]yesterdaysdate=`/bin/date -d "1 day ago" +%Y%m%d`[/COLOR] pflogsumm /var/log/maillog-[COLOR="Red"]${yesterdaysdate}[/COLOR] | formail -c -I"Subject: Mail Statistics" -I"From: pflogsumm@localhost" -I"To: [email protected]" -I"Received: from www.example.com ([192.168.0.100])" | sendmail [email protected]
Thank You I will attempt implemenatation of your suggestions shortly Additional issue with SUSE and logrotate..... I left my current logrotate script running over the weekend to verify what I had was working. To my surprise, the mail log is not being rotated daily as configured in /etc/logrotate.conf. (regardless of file name) If I add the -f switch to force a rotation, it works. Is there an additional configuration file I don't know about?? pto44128