[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: script/app to compile statistics about disk usage?

Silvan wrote:

Before I reinvent the wheel, I thought I'd see if there's already something cooked up. What I want to do is look at my disks and gather statistics about what is eating the most space. Where the biggest files are, which directories are the largest, etc. I'm running out of room, and I'm sure I must have gigabytes of stupid junk laying around, but I'm not sure where I left all of it.

I figure there's probably some find $dir -[syntax] to pick out files over some specified size, and I could do things with find|xargs du|sort|grep|gawk to pick out the heavyweight directories, but it would be nifty if there's already some handy dandy utility I haven't discovered that does this kind of thing already.

When I get desperate,as root I do things like this:
du --max-depth 2 -m | sort -n | sort

Dolphin:/# find var -type f -size +400000b | xargs ls -o
-rw-r----- 1 root 729716736 2004-01-04 06:14 var/local/KNOPPIX-3.2-Apr2003.iso
-rw-------  1 root 536870912 2003-05-02 03:51 var/swapfile
-rw-r--r--  1 root 536870912 2003-11-03 17:16 var/swapfile2

Assuming such a thing doesn't already exist, does anyone else thing some kind of handy dandy disk analyzer/reporter flummy to compile and report statistics of this nature would be worth doing in a pretty way? This almost seems worthy of becoming a hack add-on to KDiskFree or something. (Yeah, like I have time for any more projects.)

It's not something you should ask users to wait while it's done, so it should be done as a commandline thing that can be run as, say, a weekly cronjob when nobody's using the computer.

The mon package can be used to warn you before you run out of space: I suppose you could spark a run off with a mon alert (you would not _do_ the report under mon though).

It would be useful: years ago where I worked we used to get lists of files we owned and were required to mark those we wanted to keep.

These days, disk is cheap in com[arison with time, and you need to keep this in mind. It might be better to replace the drive, put the old one in a USB enclosure so you can get your important bits back. However, some will choose to spend (their own) time to manage their space.



-- spambait
1aaaaaaa@computerdatasafe.com.au  Z1aaaaaaa@computerdatasafe.com.au
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/

Reply to: