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.

/var/log/exim_rejectlog rotation

Discussion in 'E-mail Discussions' started by sehh, Apr 23, 2010.

  1. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    I would like to parse the /var/log/exim_rejectlog log file in order to draw some statistics for myself. Since this file is being rotated regularly by cPanel, I will have to figure out how this rotation works so I can take it into consideration when I code my shell script.

    Can someone please tell me how this rotation of the log file work and WHEN its supposed to rotate?

    Thank you.
     
  2. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    nobody knows? :(
     
  3. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    This is what you are wanting ....

    /etc/logrotate.d/exim
     
  4. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    The above file doesn't contain anything relevant to when the log is rotated. Based on the /etc/logrotate.conf, the logs are rotated weekly, which is not very specific... when exactly is "weekly"? Monday night? Friday morning?...

    I'll search around the man pages in case there are details.
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Look at /etc/crontab for the WHEN question ....

    (In this example "daily" crons are being run at 4:02 AM every day)

    Now in the daily cron folder (/etc/cron.daily), you find a script called "logrotate" and this is the script that triggers the actual log rotation
    and uses the configuration from /etc/logrotate.conf
     
  6. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Incidentally, if you don't entirely follow what I was try to point out ---

    The main system "root" account really has "2" different crons ....

    There is the crontab in /var/spool/cron/root that everyone knows about

    There is also a folder based cron that executes every script file found in
    the /etc/hourly, /etc/daily, /etc/weekly, and /etc/monthly folders
    respectively at the times controlled by the /etc/crontab file.

    If you want to know when an automated process is being executed, you
    are going to find it most likely in these locations ;)
     
Loading...

Share This Page