1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice


Discussion in 'Plesk for Linux - 8.x and Older' started by Swakoo, Jun 13, 2006.

  1. Swakoo

    Swakoo Guest

    Is it possible to adjust logrotate settings on the box with PLESK installed? if so, how do I do it?

    Because my mail logs are getting too big each time.. 1.4GB.. though plesk gzip it up each day, but it is still too big to use... so am wondering if i can furthur trim it smaller before it starts a new log. please advice
  2. jamesyeeoc

    jamesyeeoc Guest

    May depend on your OS, but have you checked:



    For the maillog, check in the /etc/psa/logrotate.conf file, should have a section similar to:
    /usr/local/psa/var/log/maillog.processed {
         rotate 3
         size  10M
  3. Swakoo

    Swakoo Guest

    Posted because my maillogs reached 100+MB after compression, 1.5GB+ before. amazing huh, guess its the spam.

    But I took a look at the logrotate, its already configured, as what you have mentioned. so it should be 10MB per log (before compress) right?

    And now that my multiple/spam email problem seems to subside after I implemented the SMTP timeout... the log is at >10MB per file b4 compress.

    Any idea why the log didn't maintain at 10MB per file before the problem was solved? too huge to be at 10MB? :p

    Also, I'm thinking, if I want to configure it such that I have 3 days of logs at any time, and I want each file to be 20MB (i can have multiple 20MB logfiles for one day), is it possible?
  4. jamesyeeoc

    jamesyeeoc Guest

    The only thing I can think of is that maybe something got changed in your OS's logwatch configs which changed how often the PSA logs get rotated. Sorry, that's all I can think of after a tiring Father's Day.
  5. Swakoo

    Swakoo Guest

    hmm... don remember doing anything abt logwatch on this machine (yet)

    so for PLESK logs, the controls will be in /etc/psa/logrotate.conf and settings in /etc/logrotate.conf will overwrite it?

    So you guys know how to set logrotate to do 20MB perfile, and maintain 3 day worth of log files?

    Oh yah, Happy Father's Day to you, and all the fathers here :)
    Its your day, enjoy it (like every other day, heh)
  6. Swakoo

    Swakoo Guest

    Did the above... but does it mean that it will:

    - rotate daily, for 7 days but yet split the file/rotate every 50MB (before compress)?

    Meaning to say, if each day I get 100MB worth of log, I will have 2 logs per day, 14 logs per week...?

    update: just checked the log... after 4am a new log is created (service auto restart?) but it is not compress.

    Must i specify something else other than 'compress' for the log to be gzip? or is it because the log didn't hit 50MB (it was 37MB) and thus would not get compress?)

    is it possible to choose when the log gets restart each time of the day? or is 4am a fix time when all services/log get restarted?

  7. jamesyeeoc

    jamesyeeoc Guest

    Which file is it that you put those changes in?

    I also have found another PSA related logrotate file:


    (at least on the currently logged in 7.5.4 server)

    In that file, it does not specify 'daily' at all, but has all the other options listed.

    As to the time the logrotate cronjob runs at, you would have to check/modify that with either the Plesk CP Server Cron Manager, or from the shell command prompt using 'crontab -e' when logged in as user 'root'.
  8. Swakoo

    Swakoo Guest

    I edited the one in /etc/psa/logrotate.conf

    in the url you mentioned there's only a logrotate.conf.sample file.

    Ah I found the crontab settings, not under "crontab -e" but under /etc/crontab

    I'm using 7.5.3
  9. jamesyeeoc

    jamesyeeoc Guest

    Just remembered, the one with '.in' is from a Plesk add-on from 4PSA

    7.5.3 and 7.5.4 are the same for cronjob stuff.

    The 'crontab -e' from the shell prompt would show you and allow you to edit the existing cron jobs for the logged in user, you can also add '-u username' to specify a different user, but generally if you're logged in as root, that's the crontab you want to view/edit.

    Oh, you can also use the Plesk CP to view/modify the cron jobs.
  10. Swakoo

    Swakoo Guest

    So what I modified is correct yah?

    So is it possible, say I get an average log size of 80MB a day, am I able to split it to 50MB and 30MB (basically 50MB) before compression?

    Also at the same time maintaining a 7 days log (means 14 logs a week). how do i specify that?
  11. jamesyeeoc

    jamesyeeoc Guest

    If you want 7 days of logs, and are expecting 2 logs per day, then you need to increase the rotate value, say to 14.

    Not sure why it didn't compress your logfile, not that much of a logrotate guru, I just don't worry about that little stuff, as long as I have a log I can search through....

    Other than that it looks ok to me.
  12. Swakoo

    Swakoo Guest

    i just covering the nitty gritty details .. housekeeping abit :p

    but yeah at the end of the day.. .a log is still a log
  13. jamesyeeoc

    jamesyeeoc Guest

    Housekeeping.... that's what I've been doing for several days. Turns out I found one old Plesk 6 server (the last holdout) which the maillog had not rotated since Dec 2005.

    I searched and found some who had the same problem after upgrading to Plesk 7.? (not the case here). Easy fix, but irritating that I didn't find it much sooner. (If anyone else needs the info, service syslog stop, rename/delete the file, service syslog start)

    The old 6 server has always been rock solid, so I never really put too much effort into checking the little things on it (oops).

    Have a good or great day!