Home Web Hosting Find out how to Delete Each error_log File on a cPanel Server

Find out how to Delete Each error_log File on a cPanel Server

by rigotechnology

Have you ever ever wanted to free disk area on a cPanel server with a whole lot of buyer accounts on it? A straightforward option to liberate disk area is deleting error_log information. We’ve seen buyer accounts with error_log information within the vary of 5-10GB relying on the variety of errors being logged from their web sites. Here’s a fast and straightforward set of instructions to verify error_log information and delete them, if essential.

Please make sure you have backups in case of any difficulty! Additionally, please word these instructions can take a very long time to run on resource-limited servers.

Be sure you know tips on how to verify your IP Deal with with this cool trick!

Finding error_log Information on cPanel Servers:

Find All error_log Information:
[email protected] [~]# discover /house/*/public_html -type f -name error_log -exec du -sh {} ;

Find All error_log Information and Kind by Disk Measurement:
[email protected] [~]# discover /house/*/public_html -type f -name error_log -exec du -sh {} ; | type -n

Find All error_log Information Over 100MB:
[email protected] [~]# discover /house/*/public_html -type f -name error_log -size +100000k -exec du -sh {} ;

Deleting error_log Information on cPanel Servers:

Delete All error_log Information:
[email protected] [~]# discover /house/*/public_html -type f -iname error_log -delete

Delete All error_log Information Over 100MB:
[email protected] [~]# discover /house/*/public_html -type f -iname error_log -size +100000k -delete

Cron-Primarily based Deletion of cPanel Server Error Log Information

To setup a cronjob to run one of many two deletion instructions above on a scheduled foundation, you are able to do the next:

[email protected] [~]# crontab -e

Which can open the crontab for root, then insert on the backside of the file this command to delete all error_log information on daily basis at 11PM server time:

* 23 * * * discover /house/*/public_html -type f -iname error_log -delete

Associated: Importing and Exporting Databases over command Line.

,

You may also like

Platform Slot Gacor CMS Checker