Script or cron job for Cpanel web stats management?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samsam
    Member
    • Mar 2004
    • 79

    #1

    Script or cron job for Cpanel web stats management?

    Hi:

    I'm setting up a CENTOS 4.3 LAMP web server as a basic intranet server (document sharing/ management, forum etc).

    One of the things I'd like to be able to get it to do is manage the webserver logs like cPanel does on my Dathorn external web sites - ie:

    -roll them over daily;
    -save them with names in the format site-date.log or similar;
    -then gz them all up automatically at the end of the month into a file names sitename-year-month.gz

    This is not 100% essential, but it would certainly be real handy.

    Does anyone have a ideas how I can achieve this, or the cron job syntax cPanel uses to do this?

    All advice much appreciated. The answer is probably quite simple, but I can't get my head around it.
  • AndrewT
    Administrator
    • Mar 2004
    • 3656

    #2
    I'd look into using logrotate, it should already be on the system.

    Comment

    • samsam
      Member
      • Mar 2004
      • 79

      #3
      Originally posted by AndrewT
      I'd look into using logrotate, it should already be on the system.
      Thanks Andrew.

      Is that what cPanel uses?

      You couldn't cut-and-paste me the bash scripts or perl jobs cPanel uses, could you, or whatever they are using (inc logrotate)?

      I could Google the matter, but I am at the moment all Linux-ed out. You know what I mean I am sure.

      (GOD I miss my old Windows 2000 IIS server. Life was so much easier then.)

      Comment

      • AndrewT
        Administrator
        • Mar 2004
        • 3656

        #4
        cPanel's setup is fairly complicated and I would not use it at all. logrotate is far more reliable.

        Comment

        Working...