Portal Home > Knowledgebase > Articles Database > How to clear ERROR LOG for a particular account in Centos?
How to clear ERROR LOG for a particular account in Centos?
Posted by SuperBaby, 05-29-2012, 03:39 AM |
How to clear ERROR LOG for a certain account in Centos? I am running cPanel. I would like to purge all old error log for a certain customer's domain and start with new.
|
Posted by net, 05-29-2012, 04:26 AM |
Moved > Hosting Security and Technology .
|
Posted by sodapopinski, 05-29-2012, 04:46 AM |
I run the following command regularly to clear my customer's error_log file to save some disk space.
find /home/ -size +1240k -name error_log -exec rm -rf {} \;
That will delete any error_log file which more than 1Mb file size. Feel free to change the value.
|
Posted by SuperBaby, 05-29-2012, 08:38 AM |
I tried the command but doesn't seem to work. I actually want to clear the error log under the account's cPanel.
I tested the command, then logged in to the domain's cPanel and checked the error log. The list is still long.
|
Posted by MilesWeb, 05-29-2012, 09:48 AM |
There are 2 options you can try.. You can either delete them OR empty them
To delete
cd /home/cPanel-username
find -type f -name error_log -exec rm -f {} \;
To empty
cd /home/cPanel-username
for i in `find -name error_log`; do echo > $i; done
If you are unsure, contact your webhost.
|
Add to Favourites Print this Article
Also Read
Strange File (Views: 609)
InnoHost (Views: 708)