Welcome to WebmasterWorld Guest from 54.144.124.152

Forum Moderators: bakedjake

Message Too Old, No Replies

What's eating up our HD?

How can we know? And what is DU?

     

gutabo

4:34 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



Greetings,

We have a web site(0.8GB) on a 2.5GB hosting package(a VPS). However, we're getting waring mails about having only 10% of disk space left, and we gzip and download our logs on a daily basis. And how do you use DU? We've tried to use it but we have to get into every single directory to check it, and we have TONS of folders...

Thanks in advance!

RobinC

4:49 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



You'd need a proper linux guru to answer, but iirc all files and directories take a certain amount of header space too - they might also be rounding up to the nearest block. I might be wrong mind you ;-)

Another possibility is if there's a full snapshot as backup - which would really eat into your allotment.

Personally I'd email the provider and ask them where all the space is diappearing to...

quotations

4:57 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



Won't it go through the directories recursively?

For example,

# du /home ¦ sort -nr ¦ more

Should give you reverse numeric sorted space usage for every directory from /home down.

# du / ¦ sort -nr ¦ more

Should give you reverse numeric sorted space usage for the entire drive.

# du /home ¦ sort -nr > /du.txt

Should give you reverse numeric sorted space usage for the entire drive in a file /du.txt.

Put that in a cron job with >> and an echo $date and you should have a running log of what is going on.

gutabo

5:16 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



"Put that in a cron job with >> and an echo $date and you should have a running log of what is going on."

Mind helping me out with that? I know how to set a crontab, but I don't know how to use the syntax that much... :'(

gutabo

5:17 pm on Oct 20, 2003 (gmt 0)

10+ Year Member



...And thanks! ^_^

gutabo

2:24 am on Oct 21, 2003 (gmt 0)

10+ Year Member



HELP!

I can't run a cronjob with du, I get this:
du: : No such file or directory
du: sort: No such file or directory
du: -nr: No such file or directory
Please help me!

stechert

8:51 am on Oct 21, 2003 (gmt 0)

10+ Year Member



if you want to get a more summarized report using du, try doing something like "du -sk *" in the root of your site.

-s means "just give me the summary for the named item"
-k means "give it to me in Kbytes, not bytes"
* means "for all of the subdirs immediately below my dir, but not their subdirs"

Cheers,
Andre

Josk

9:33 am on Oct 21, 2003 (gmt 0)

10+ Year Member



Remember 'man'. Give you the manual for a command. So 'man du' will give you the manual page for du.

You may need to put the full path of a command. Use 'whereis xyz' to find something. Eg, 'whereis du' gives 'du: /usr/bin/du /usr/share/man/man1/du.1.gz'. This tells you that du is located in /usr/bin and has a man page in /usr/share/man/man1/. Do the same for sort, etc.

kenta

11:33 am on Oct 21, 2003 (gmt 0)

10+ Year Member



If it's a VPS I assume you have multiple partitions. Did the warning e-mail say where the problem was?

You might want to just check "df -m" and see which partitions are eating up space.

gutabo

5:24 pm on Oct 21, 2003 (gmt 0)

10+ Year Member



Thanks for your replies!

I tried to use the whereis command and it works but there's this warning:

Warning: couldn't stat file /usr/share/perl/man!

What does it mean?

I C&Ped a warning mail above(in a previous post)...

Here: I just tested this:

40 15 * * * /usr/bin/du / /usr/bin/sort -nr >> /path/to/file/dulog.`/bin/date +\%m\%d`.txt

This is the error message I got(I think it has something to do with the "")

du: : No such file or directory
du: -nr: No such file or directory

Isn't there a way to have something like this:
root 45kb
folder1 56456kb
folder2 3435kb
folder3 8766kb

So I can see how much does each folder(and subfloder below it) has but not get it listed(just the parent), so I can see that (in the example) folder1 is obviously the one with the "burden"?

Thanks in advance!

drbrain

10:55 pm on Oct 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



df -h will tell you which mountpoint is at capacity.

go there then type

du -d1 -h

depth 1, human-readable output, from this directory.

To run from the crontab, you probably need to put the string in quotes. See crontab(5) (that's man 5 crontab).

danny

4:48 am on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



DU is depleted uranium... stay away from that stuff!

[Unix commands aren't capitalised. Case sensitivity means that DU could be something completely different to du.]

gutabo

5:22 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



Thanks for your replies!

I can finally have an estimated of what's going on in our VPS. Now if I could only place it in a crontab... Any help there?

Thanks again!

 

Featured Threads

Hot Threads This Week

Hot Threads This Month