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!

  • Manually run ClamAV on cPanel and check every userManually run ClamAV on cPanel and check every user If you’re running WHM/cpanel and want to run a scan on every user manually, perhaps when first installing ClamAV, you’ll want to run this command which is endorsed by cPanel […]
  • Migrating from Plesk to cPanel via commandlineMigrating from Plesk to cPanel via commandline If you’re anything like me, you prefer to do things via command line (CLI) rather than relying on a GUI to do most things in Linux. You also realize that while some of us don’t like to use […]
  • Easily increase storage size with LVMEasily increase storage size with LVM Your server needs more space eh? Throw another physical drive in there and let’s use that to increase the logical volume that needs more space! In this example, we are going to use a […]
  • Block Countries using mod_geoip in cPanelBlock Countries using mod_geoip in cPanel Yesterday, I wrote an article on how to block certain countries from your server using csf. This will block them from accessing your server on any port. You can, however use mod_geoip if […]
  • Change main hostname and IP of WHM/cPanel machineChange main hostname and IP of WHM/cPanel machine One thing you’ll probably run into sometime is changing the hostname and IP address of a cPanel machine.. whether you’re cloning it for a quick start or if you’ve taken it over.. moving it […]

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=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">