Locating error_log Files on cPanel Servers:
Locate All error_log Files:
root@server [~]# find /home/*/public_html -type f -name error_log -exec du -sh {} ;
Locate All error_log Files and Sort by Disk Size:
root@server [~]# find /home/*/public_html -type f -name error_log -exec du -sh {} ; | sort -n
Locate All error_log Files Over 100MB:
root@server [~]# find /home/*/public_html -type f -name error_log -size +100000k -exec du -sh {} ;
Deleting error_log Files on cPanel Servers:
Delete All error_log Files:
root@server [~]# find /home/*/public_html -type f -iname error_log -delete
Delete All error_log Files Over 100MB:
root@server [~]# find /home/*/public_html -type f -iname error_log -size +100000k -delete
Cron-Based Deletion of cPanel Server Error Log Files
To set up a cronjob to run one of the two deletion commands above on a scheduled basis, you can do the following:
root@server [~]# crontab -e
Which will open the crontab for root, then insert at the bottom of the file this command to delete all error_log files every day at 11PM server time:
* 23 * * * find /home/*/public_html -type f -iname error_log -delete