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
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
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.
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
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.![]()
thanksI will try the settings you suggested and see if that helps before I apply the cronjob
Thanks again!
Emma
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.