How to delete error_log files of all accounts on a cPanel server

Error_log file saves the error logs of a account / user / website. There can be multiple error_log file under one user account.

These error_log files can consume lots of space on your server. Sometimes the size of error_log files are in GB. So, you may want to delete all error_log files to free up some space on server.

Login in to server via SSH as root user and execute following command:

find /home -type f -name error_log -exec rm -f {} \;

The above command will search for error_log files in /home directory for all users accounts /Websites and delete them. 

1) This command can take some time to complete depending upon size of your /home directory. Sometimes it may take 10-30 minutes to complete.

2) After that If required server will automatically create new error_log files.

Done!!