TechsRx Logo Top Slice TechsRx Computer Services - Business Stong :: People Friendly
Follow TechsRx on Twitter      TechsRx Facebook Fan Page
TechsRx Logo Bottom Slice Local: 505-897-2996 Toll Free 1.877.TECHS1X (832-4719)
  TechsRx HOME     SUPPORT FORUM        Friday, July 30, 2010 

So your Linux, Apache, MySql, PHP Servers Hard Drive is Full

TechsRx has been hosting websites for about 6 years now and many of our hosting servers are on virtual hosting plans or VPS servers. These servers generally have root access that you manage yourself. This includes the control panel the operating system and all its updates not to mention all the customers and domains and websites. It has mostly been trouble free but when things go south it can be a little frustrating. One of the issues that has happened often is the disk or ard drive becomes full usually because of a log file hat has gone crazy or sometimes if you haven’t set limits on your email or ftp users you get some large files. I have forund the following commands very helpful in locating the large files and dealing with them.

First run:

df -h

This will tell you how much disk space you have then to find files larger then 20MB eter this command

find / -type f -size +20000k -exec ls -lh {} ; | awk '{ print $9 ": " $5 }'

For files larger then 45MB use this

find / -type f -size +45000k -exec ls -lh {} ; | awk '{ print $9 ": " $5 }'

This will clear  a run away log file

cat /dev/null > large_log_file.log

OR

:> large_log_file.log

To Delete a file without being prompted

rm -f large_stupid_file

It’s that simple.

Because of the nature of Linux and the open source community their is probably 100 ways to this.

Please tell us about methods you have used to accomplish the same thing.

Be Well With Your Technology..

TechsRx

Popularity: 74% [?]

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • MySpace
  • StumbleUpon
  • Twitter

One Response to “So your Linux, Apache, MySql, PHP Servers Hard Drive is Full”

  1. Here I am commenting on my own post only becuase I just got the site up and running and need to test the comments and the rss feed. I hope to get others commenting soon.

Leave a Reply

By submitting a comment here you grant TechsRx a perpetual license to reproduce your words and name/web site in attribution.

transparent pixel spacer
BUY NOW   |    LEARN NOW   |    FIX NOW   |    Web Services & Domains   |    4 Color Printing
transparent pixel spacer