Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Aug 2003
    Posts
    6

    Default CronJob for Apache Error Log

    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. #2
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    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.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  3. #3
    Member
    Join Date
    Aug 2003
    Posts
    6

    Default

    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. #4
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    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.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  5. #5
    Member
    Join Date
    Aug 2003
    Posts
    6

    Default

    thanks I will try the settings you suggested and see if that helps before I apply the cronjob

    Thanks again!
    Emma

  6. #6
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    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.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

Similar Threads & Tags
Similar threads

  1. Splitting Apache Error Log Into Error Types
    By chips12 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-29-2011, 03:02 AM
  2. Apache error log discription
    By thewebhosting in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-15-2009, 03:28 AM
  3. clear apache error log
    By Gaming-Heaven in forum New User Questions
    Replies: 3
    Last Post: 05-04-2007, 09:37 PM
  4. Apache Error log - what some lines means
    By the_bobara in forum New User Questions
    Replies: 4
    Last Post: 04-10-2005, 09:41 AM
  5. mod_attach.c errors in apache error log
    By casey in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-20-2003, 06:59 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube