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

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

These error_log files may 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 server via SSH as root 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 and delete them. Thus it will delete all error_log files under all users / accounts / cPanel accounts / websites.

Note:

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

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

[dedicated_hosting]

Our Top Rated Host

Related Posts