Delete cPanel account error_log files

Rob —  July 24, 2014 — Leave a comment

If you have a large number of accounts on your server, you may also be wasting a lot of space with the error_log files in each account. Some can get very large – and while you want to keep an eye on what the server is complaining about, once you read through them, you can wipe them out with one swift command.

Let’s first see how much space they’re all using!

SSH to the server in question and type this command to list out all of the account error_logs along with their size:

On the left, you’ll see the size, on the right you’ll see the path.

I’d take a peek at what some of the bigger ones are complaining about to see if you can fix the issues. Once you’re finished up, we’ll delete them all (and apache will re-create them if it wants/needs to).

Ok, so we’re assuming you’ve read through and gained any knowledge of what the server was complaining about (and remedied any issues!).

Let’s delete those suckers! Typing the following command will delete all instances of ‘error_log’ beneath the /home/ directory.

Now, you can follow up with the previous command and you should be met with nothing except your shell prompt.

I’d suggest that you schedule a cron job to clear them out weekly.. like, let’s clear them out every friday night:

Thanks for reading! Share this w/ your friends!

Related posts from Linux Brigade!

No Comments

Be the first to start the conversation.

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url=""> 

*