Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Rotate Exim logs daily

Discussion in 'E-mail Discussions' started by rligg, Apr 21, 2014.

  1. rligg

    rligg Well-Known Member

    Joined:
    Sep 16, 2003
    Messages:
    277
    Likes Received:
    0
    Trophy Points:
    166
    I have searched and could not find what setting to use to rotate the exim logs daily.

    I know you are supposed to edit /etc/logrotate.d/exim

    Currently I have it set to Rotate 1 which is weekly. I am experiencing some huge logs due to an exim Syntax Attack. I have deployed some syntax rules in csf, but I want to play it safe until the attack subsides.
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    829
    Likes Received:
    25
    Trophy Points:
    168
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    The /etc/logrotate.conf defines the intervals for rotation, and RHEL/CentOS sets this to 'weekly' by default. You can change this value, but doing so will affect all rotation definitions in /etc/logrotate.d/. What you can try, though, is editing /etc/logrotate.d/exim and add 'daily' to the definitions:

    Code:
    /var/log/exim_mainlog {
        daily
        create 0640 mailnull mail
        compress
        postrotate
        /usr/bin/killall -HUP exim
        endscript
    }
    
    You can further add 'rotate X' to the same block to specify how many copies to keep. ie, 'rotate 7' should keep for up to 7 days.

    I haven't actually tried this outside of definitions in logrotate.conf, so do give it a try and let us know how it works out.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,165
    Likes Received:
    1,371
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    The instructions in the previous post should work. Let us know the outcome or if you have any additional questions.

    Thank you.
     
Loading...

Share This Page