SUSE 10.3 and postfix/pflogsumm/logrotate

Discussion in 'Server Operation' started by pto44128, Mar 15, 2008.

  1. pto44128

    pto44128 New Member

    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 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 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 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
  2. falko

    falko Super Moderator

    Instead of using

    pflogsumm /var/log/maillog.0 | formail -c -I"Subject: Mail Statistics" -I"From: pflogsumm@localhost" -I"To:" -I"Received: from ([])" | sendmail
    in the /usr/local/sbin/ script, you can try this:

    [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:" -I"Received: from ([])" | sendmail
  3. pto44128

    pto44128 New Member

    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??

  4. falko

    falko Super Moderator

    Take a look at the /etc/logrotate.d directory.

Share This Page