How to remove error_log from all CPanel account and backups

Some scripts like WordPress and Joomla can leave a big error_log files that no one will ever look at. Try opening a 30mb log file with Word and see what happens. In most cases you can just remove this file with a simple command.

To remove all error_log files for CPanel accounts that are live use:

find /home/ -type f -name error_log -delete

To remove all error_log files from backups use:

find /backup/ -type f -name error_log -delete

This will take a while to complete because it will look through every file, it also runs pretty smooth so just sit back and let it work it’s magic.

 

Removing the eximstats file

You can modify the following option in “WHM Home » Server Configuration » Tweak Settings” under the “Stats and Logs” tab:

“The interval, in days, to retain Exim stats in the database”

Reducing this value will decrease the amount of data that is stored in the Eximstats database.  If you decide to drop the eximstats tables completely, you can generate a new instance of the tables via:

Code:
/usr/local/cpanel/bin/updateeximstats