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% [?]




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.