Or you can try this quick perl script I just hacked out about 5 mins. ago. Feel free to modify to your heart's content. It's called mydu and it takes as an argument the top level directory you want to scan. It just skips ., .., and .snapshot.
Enjoy!
-- Adam Fox NetApp Professional Services, NC adamfox@netapp.com
#!/bin/perl # # Usage mydu [dir] # opendir (DIR, $ARGV[0]) || die "Can't open $ARGV[0] $!"; @dirs = readdir(DIR); closedir (DIR); foreach $d (@dirs) { next if ($d eq "." || $d eq ".." || $d eq ".snapshot"); system ("du -s $ARGV[0]/$d"); }
-----Original Message----- From: Timothy A. McCarthy [mailto:tmac@netapp.com] Sent: Monday, May 21, 2001 8:19 AM To: Nicholas, Chua Cc: toasters@mathworks.com Subject: Re: du without the .snapshot
Get the gnu version of du and modify the source to not go into .snapshot
--tmac
"Nicholas, Chua" wrote:
Hi all,
I have a few directories that are automounted from NetApp
F720 Filer to the
SUN boxes. The mounted directories are directories under
qtrees. .snapshot
is accessible under all mountpoints. The issue I have is
when doing du to
query the directory usage, there will be error messages due
to permission
level of contents beneath the .snapshot.
I would like to get the correct disk usage of my mounted
directories. One
way to do it is to disable access to the snapshot
directories by "vol
options volumename nosnapdir on". Is there anyway of
getting the correct
output of du without accessing the .snapshot directories
and not having to
turn off and on the options each time, perhaps the right
options of du to
bypass that particular directories?
Thanks for any input. Nic
-- ******All New Numbers!!!******
Timothy A. McCarthy --> System Engineer, Eastern Region Network Appliance http://www.netapp.com 240-268-2034 Office \ / Page Me at: 240-268-2001 Fax / 888-971-4468