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

Logrotate Not Working

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by LloydD, Jun 13, 2011.

  1. LloydD

    LloydD Basic Pleskian

    19
    60%
    Joined:
    Jul 18, 2010
    Messages:
    92
    Likes Received:
    0
    Location:
    Suffolk, UK
    Hi everyone,
    I'm running a VPS with Ubuntu 8.04 LTS with Plesk 9.5.4 and set the domains to rotate once a month but it never happened so now I have a 340mb access.log and 160MB access_ssl.log.
    There's no logrotate file in /etc/cron.monthly just a .50plesk-monthly and .place-holder. There is a logrotate file in the cron-daily folder.
    Is there a command I can run on a per domain basis?
    Thanks in advance for any help
    Kind regards

    Lloyd
     
  2. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    cat /etc/cron.daily/logrotate

     
  3. LloydD

    LloydD Basic Pleskian

    19
    60%
    Joined:
    Jul 18, 2010
    Messages:
    92
    Likes Received:
    0
    Location:
    Suffolk, UK
    Sorry for the delay,

    /etc/cron.daily/logrotate

    and

    /etc/logrotate.conf

    There is no logrotate in /etc/cron.monthly.
    Thanks in advance for your help
    Kind regards

    Lloyd
     
  4. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    That all looks pretty normal - can you double check that you actually set the domains to use logrotate and its by date and not by size or number?
     
  5. LloydD

    LloydD Basic Pleskian

    19
    60%
    Joined:
    Jul 18, 2010
    Messages:
    92
    Likes Received:
    0
    Location:
    Suffolk, UK
    The system has been running for about a year and a half, in that time I have tried monthly daily and by size, none work.
    I just ran

    logrotate -f /etc/logrotate.conf

    Which rotated alot of logs, but didn't touch the domain logs.
    Should Plesk have written something to the logrotate.conf?
    Something like..

    /var/www/vhosts/domain wildcard?/statistics/logs/* {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
    }

    I don't know, I hope someone can shed some light on the subject.
    Thanks for the help so far.
    Kind regards

    Lloyd
     
  6. LloydD

    LloydD Basic Pleskian

    19
    60%
    Joined:
    Jul 18, 2010
    Messages:
    92
    Likes Received:
    0
    Location:
    Suffolk, UK
    Ok so I have found where Plesk stores the logrotate files for the domains..

    /usr/local/psa/etc/logrotate.d

    Should I just add the above path to the /etc/logrotate.conf?
    Thanks for your patience
     
  7. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    Plesk logrotate settings are stored here

    /usr/local/psa/etc/logrotate.conf

    it has a include line as its #1 line
    include /usr/local/psa/etc/logrotate.d

    inside that directory you will find the domains, and each domain will have its log files there

     
  8. LloydD

    LloydD Basic Pleskian

    19
    60%
    Joined:
    Jul 18, 2010
    Messages:
    92
    Likes Received:
    0
    Location:
    Suffolk, UK
    So I should run..

    logrotate -f /usr/local/psa/etc/logrotate.conf

    Simple as that?
     
  9. LloydD

    LloydD Basic Pleskian

    19
    60%
    Joined:
    Jul 18, 2010
    Messages:
    92
    Likes Received:
    0
    Location:
    Suffolk, UK
    Well that nearly did the trick, to start with it only did the error log so I just copied that entry in /usr/local/psa/etc/logrotate.d/my-domain.com and corrected the access_log and access_ssl_log file paths.
    Job done, except how do I get it to do it monthly automatically
    Should I ammend the main /etc/logrotate.conf so there are 2 include entries..

    include /etc/logrotate.d
    include /usr/local/psa/etc/logrotate.conf

    Or should I just add a cron job to run it.
    Thanks for all your help on this matter, it's much appreciated
     
  10. Amin Taheri

    Amin Taheri Golden Pleskian Plesk Certified Professional

    33
     
    Joined:
    Jul 5, 2007
    Messages:
    1,398
    Likes Received:
    1
    Location:
    Seattle Area
    probably the cron, that way you have more control.
     
Loading...