Re: large files
--On Thursday, April 24, 2003 15:43:31 -0600 David Bishop [EMAIL PROTECTED] wrote: I have a user that really like to create files. Then, they don't clean them up. We have already put a quota* on them, but unfortunetly, their directory is so large and convaluted, that they can't even figure out where all the disk space has gone. Is there a sane way to generate a report showing the disk usage from a certain point on down, sorted by size? Heres kinda what I mean: for a standard user, I would just run 'du /u/foo | sort -n | tail -20', and tell them to clean up whatever is there. However, I've let a du | sort -n run on this directory for over four hours, before giving up in disgust. It is almost 100Gigs of files, with at least four or five directories that have 20K to 30K+ files each (plus hundreds of other subdirs). *And*, it's on a filer, so there are .snapshot directories that du thinks it has to plow through, quintupling the amount of work. I'd also like to make this into a weekly report, so that they can make it part of their Friday routine (let's go delete 10 gigs of data! Woohoo!). Ideas? Other than killing them, of course, no matter how tempting that is... Maybe use find and restrict the search depth to at least find some large dirs, plus exclude the snapshots? Sth like find /where/ever -size +1k for the larger files, and for large dirs maybe, haven't tried, ... -size +1k - type d. If you pipe this through awk you can easily sum it up. I remember once writing a script to reporting disk usage on a web server above the purchased amount. Cheers, Marcel
RE: large files
please pardon me using Outbreak, I'm browsing the list from work, and it's what I have... Ideas? Other than killing them, of course, no matter how tempting that is... I think you've gotten some good ideas so far, including the --max-depth= option to restrict the depth of search, and another one that I use quite a bit on my home system is --exclude. I didn't see you mention it, but using --exclude you could tell 'du' to ignore the .snapshot directories and other stuff you know isn't the problem, or just want it to 'overlook'. Comes in handy when doing a 'du' on the / directory, otherwise du wants to tally up /proc... Eeek! HTH, Monte
large files
I have a user that really like to create files. Then, they don't clean them up. We have already put a quota* on them, but unfortunetly, their directory is so large and convaluted, that they can't even figure out where all the disk space has gone. Is there a sane way to generate a report showing the disk usage from a certain point on down, sorted by size? Heres kinda what I mean: for a standard user, I would just run 'du /u/foo | sort -n | tail -20', and tell them to clean up whatever is there. However, I've let a du | sort -n run on this directory for over four hours, before giving up in disgust. It is almost 100Gigs of files, with at least four or five directories that have 20K to 30K+ files each (plus hundreds of other subdirs). *And*, it's on a filer, so there are .snapshot directories that du thinks it has to plow through, quintupling the amount of work. I'd also like to make this into a weekly report, so that they can make it part of their Friday routine (let's go delete 10 gigs of data! Woohoo!). Ideas? Other than killing them, of course, no matter how tempting that is... *100Gigs! -- MuMlutlitithtrhreeaadededd s siigngnatatuurere D.A.Bishop
Re: large files
On Fri, 25 Apr 2003 07:43 am, David Bishop wrote: I have a user that really like to create files. Then, they don't clean them up. We have already put a quota* on them, but unfortunetly, their directory is so large and convaluted, that they can't even figure out where all the disk space has gone. Is there a sane way to generate a report showing the disk usage from a certain point on down, sorted by size? Heres kinda what I mean: for a standard user, I would just run 'du /u/foo | sort -n | tail -20', and tell them to clean up whatever is there. However, I've let a du | sort -n run on this directory for over four hours, before giving up in disgust. It is almost 100Gigs of files, with at least four or five directories that have 20K to 30K+ files each (plus hundreds of other subdirs). *And*, it's on a filer, so there are .snapshot directories that du thinks it has to plow through, quintupling the amount of work. I'd also like to make this into a weekly report, so that they can make it part of their Friday routine (let's go delete 10 gigs of data! Woohoo!). Ideas? Other than killing them, of course, no matter how tempting that is... *100Gigs! I'd play with the --max-depth settings on du, this will allow you to limit the output a bit, however it will still have to run over the entire directory tree to count it. Failing that, if you suspect it's some really big files taking up the room then a find with -size +1000k or similar might be your friend. t -- GPG : http://n12turbo.com/tarragon/public.key
Re: large files
On Thursday 24 April 2003 04:33 pm, Tarragon Allen wrote: On Fri, 25 Apr 2003 07:43 am, David Bishop wrote: I have a user that really like to create files. Then, they don't clean them up. We have already put a quota* on them, but unfortunetly, their directory is so large and convaluted, that they can't even figure out where all the disk space has gone. Is there a sane way to generate a report showing the disk usage from a certain point on down, sorted by size? Heres kinda what I mean: for a standard user, I would just run 'du /u/foo | sort -n | tail -20', and tell them to clean up whatever is there. However, I've let a du | sort -n run on this directory for over four hours, before giving up in disgust. It is almost 100Gigs of files, with at least four or five directories that have 20K to 30K+ files each (plus hundreds of other subdirs). *And*, it's on a filer, so there are .snapshot directories that du thinks it has to plow through, quintupling the amount of work. I'd also like to make this into a weekly report, so that they can make it part of their Friday routine (let's go delete 10 gigs of data! Woohoo!). Ideas? Other than killing them, of course, no matter how tempting that is... *100Gigs! I'd play with the --max-depth settings on du, this will allow you to limit the output a bit, however it will still have to run over the entire directory tree to count it. Failing that, if you suspect it's some really big files taking up the room then a find with -size +1000k or similar might be your friend. You're gonna think I'm an idiot, but I read the man page on du probably 3 or 4 times, and never saw the max_depth. Thanks, I'll play with that. -- MuMlutlitithtrhreeaadededd s siigngnatatuurere D.A.Bishop