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.

cPanel noob, question about /statistics/logs

Discussion in 'General Discussion' started by srossnz, Aug 16, 2008.

  1. srossnz

    srossnz Registered

    Joined:
    Aug 16, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I am trying to keep my backups as small as possible. I am assuming the cPanel automated backups include /statistics/logs files? If so I notice that I have some big ones:

    mainly: access_log.processed which is over 1gig

    then a series of zipped access logs such as:
    access_log.processed.3.gz

    It looks like the zipped ones are created nightly on a rotation. Do I need these zipped ones for any reason? Is it ok to just delete them?

    As for the 1gig+ file can I do anything to keep this down? Like some sort of configuration to ensure they do not get over 200meg in size or auto zip after 200meg? I think my nightly backups might be an extra 1-2gigs because of these logs.

    Thanks for any advice and please keep in mind I'm not a linux guru so if you can give simple advice that would be great.
     
  2. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Yes, zipped ones are created due to log rotation that Linux does it by default. If no rotation would occur on the various log files, then they will just grow bigger and bigger, filling up the space but most importantly making it very difficult to find any information that we might be looking for in those log files.

    Logrotate is the default application used to rotate all logs files. It allows automatic rotation, compression, removal of log files and each file can be handled daily, weekly, monthly or depending on the size (in your case it looks like the rotation is configured as per size).

    Normally, logrotate is run as a daily cron job and the script is /etc/cron.daily/logrotate. The configuration file of logrotate is /etc/logrotate.conf which explains everything in a simple manner. And various packages have their own configuration file under /etc/logrotate.d/ directory.

    In your case it looks like the log rotation is set to rotate 3 times. You can rotate the logs just twice by changing the 'rotate' option to 2 in /etc/logrotate.conf file.
     
Loading...

Share This Page