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.

CronJob for Apache Error Log

Discussion in 'EasyApache' started by Emma, Feb 21, 2005.

  1. Emma

    Emma Member

    Joined:
    Aug 12, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I am needing to create a cronjob that deletes my error log every hour, so far I have the standard cpanel set up with the command to run being: wget -q -O /dev/null > /usr/local/apache/domlogs/fanbolt.com

    is this the correct command?

    Thank you :)
    Emma
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Is it your error log or your access log you want to empty? /usr/local/apache/domlogs/fanbolt.com is the access log for fanbolt.com. Errors are logged in /usr/local/apache/logs/error_log.

    If it is your error log you want to delete, why? If the error log is growing too fast, it makes more sense to fix the errors. Also, the error log is where errors for all sites are recorded, so deleting it deletes all users error logs.
     
  3. Emma

    Emma Member

    Joined:
    Aug 12, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I am guessing its my access log then b/c it's located in user/local/apache/domlogs. Sorry for the mixup. Should that command line take care of it?

    Emma
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    That would make more sense because if a site is very busy, the access log can grow fast, but if you delete it every hour, your stats programs won't work right.

    The best thing to do is go in WHM "Tweak Settings" and check the box for "Delete each domain's access logs after stats run", and then change "Number of days between processing log files and bandwidth usage" on the same page to .25 which would cause processing and deletion every 6 hours.

    I'm not certain about the line you are wondering about, but there are others here who will know for sure. My shell commands knowledge is still a little rough. ;)
     
  5. Emma

    Emma Member

    Joined:
    Aug 12, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    thanks :) I will try the settings you suggested and see if that helps before I apply the cronjob :)

    Thanks again!
    Emma
     
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    No problem. The .25 day setting is something I did a year ago when log files were getting so big that it took a long time to process log files and I found that by processing more often, it was much easier.
     
Loading...

Share This Page