Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a CentOS web server which does not have much load on it. I noticed that its available disk space drops by more than 100MB every few days.

There isn't any new software installed, however there is a daily system upgrade yum update cron job.

I can be sure that /var/log is not growing a lot.

How do I find out which directory is growing its size too fast?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

You can type as root:

nice du / -ms | sort -rn > report-usage-20130429.txt

Witch gives a listing of all directories and usage in MBytes sorted reversed. If you compare the next day listing with this one you maybe you can detect where the space is going. Could be advised to activate a script that every day sends and email with a report of usage so that you cant track the problem. You can also install nagios to inform you when space is getting critical.

share|improve this answer
    
the command does not give a desired output (it only gives count of blocks of /), however you pointed me to the right direction. I will write a simple script to du directories 2 levels down from / and read the report every day. –  Howard Apr 29 '13 at 0:17
1  
Seems a good starting point. I didn't knew what version of CentOS you have so that your data could be on /home our /var. Beware that sometimes the problem is on directories where you least expect. ex. /tmp /root. –  cfreire Apr 29 '13 at 0:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.