Alternatively, you can use a "du"-like script which avoids traversing the ".snapshot" directory:
#!/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"); }
Brian Pauley Systems Engineer Dataline, Inc
2551 Eltham Avenue, Suite O Norfolk, VA 23513 Phone (757)858-0613 ext. 264 Fax (757)858-0606 email: brian.pauley@dataline.com
-----Original Message----- From: owner-toasters@mathworks.com [mailto:owner-toasters@mathworks.com] On Behalf Of Andrew Siegel Sent: Thursday, November 10, 2005 2:13 PM To: Lori Barfield Cc: toasters@mathworks.com Subject: Re: howto document for initial volume architecting?
Lori Barfield wrote:
stupidly, i counted the space each data directory is taking with du -sk, so i got the snaps as well and all the numbers are off. i guess today i'm going to be adding up directory sizes with a massive find -prune loop.
(or is there a better way?)
One trick for doing du's without encountering any .snapshot directories is to do the du within a snapshot.