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.

Logs rotation

Discussion in 'General Discussion' started by dwh, Apr 22, 2002.

  1. dwh

    dwh Member

    Joined:
    Mar 5, 2002
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Are my logs supposed to rotate? is there a script that does this? Because it doesn't seem to be happening.
     
  2. Xnet

    Xnet Member

    Joined:
    Feb 8, 2002
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    This is from the VO help file

    - - - - - - -

    Sometimes your logs are just too big and fill up too fast for the current partition they are on. A simple solution to this is to move them to a different partition. For example, let’s say your /usr partition is over %90 and every time you delete your logs, within a few hours it is back at %90 again. The solution is simple and we will discuss how to do this.

    First thing you need to do is to move your logs. We recommend you shut down the service that uses this log along with the chkservd daemon which checks your services. In this example you would want to shutdown chkservd followed by Apache:

    /etc/rc.d/init.d/chkservd stop

    /etc/rc.d/init.d/httpd stop

    Then you would move the two directories to a different partition. Most people use their /home partition, but if you have a backup drive in your server you may want to use it. I prefer to use my backup drive (for logs, since I don't consider my logs to be critical data) as this takes some of the work off the main drive, so I would create a directory on my backup drive:

    mkdir /backup/usr/

    Then I would move the directories over:

    mv /usr/local/apache/domlogs /backup/usr/

    mv /usr/local/apache/logs /backup/usr/

    That will move the two major log directories from your /usr partition to your /backup partition. The last thing you need to do is create the symbolic links in the ‘old’ locations so that Apache can find where you have moved these logs.

    cd /usr/local/apache/

    ln –s /backup/usr/domlogs/ domlogs

    ln –s /backup/usr/logs/ logs

    This will create the links in the ‘old’ location to point to the ‘new’ location. The last thing to do is restart Apache and chkservd:

    /etc/rc.d/init.d/httpd start

    /etc/rc.d/init.d/chkservd start

    And that’s it! Your logs are now stored on your backup partition and will never hassle your /usr partition again.
     
  3. dwh

    dwh Member

    Joined:
    Mar 5, 2002
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Thanks so much was a graet help!
     
Loading...

Share This Page