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.

exim log rotation - keeping logs longer

Discussion in 'General Discussion' started by jamesbond, Jul 16, 2004.

  1. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    How can I change the exim log rotation settings?

    Now it does weekly rotation and keeps logs for 4 weeks.
    I would like to keep the logs for longer than for weeks, I haven't been able to figure out how and where to change that.
     
  2. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    read man logrotate

    then edit /etc/logrotate.d/exim accordingly

    So, if you want to keep logfiles for 6 weeks, you would add the line

    rotate 6

    prior to the compress command for each of the respective logs you wish to keep for a longer period of time.
     
  3. fizz

    fizz Well-Known Member

    Joined:
    Jan 25, 2002
    Messages:
    202
    Likes Received:
    0
    Trophy Points:
    16
    Just a friendly word of warning..

    If you receive a few thousand emails in a day, then this will ultimatly create a very large log file, and which will result in degraded system performance. I use MRTG to monitor system resources, and actually changed this to 1 day instead of 1 week, and performance increased 10fold!
     
  4. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    Thanks for your help, but I think you misunderstood what I was trying to explain.

    I don't want to change the rotation frequency (weekly).
    All I want is to keep the archived logs for more than 4 weeks.
     
  5. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    Then modify as suggested above by adding the

    rotate x (substitute the number of weeks you want to keep the logs for x)
     
  6. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    Thanks bamasbest that seems to be the option I was searching for :)

    I assume the default value of rotate is 4 then and it is set to weekly by default also?
    I'm asking because I don't see it mentioned in the original /etc/logrotate.d/exim
     
    #6 jamesbond, Jul 16, 2004
    Last edited: Jul 16, 2004
  7. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    the defaults for logrotation are located at /etc/logrotate.conf

    Yes, the default is weekly and 4 for RPM installs. Modifying any of the files in /etc/logrotate.d will override the defaults.
     
  8. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    Excellent, thank you for your help.
     
Loading...

Share This Page