Here is a perl script my coworker wrote that pretty closely mimics the du command. The solutions I saw here yesterday aren't close enough for my taste. Du should print a summary at the end of output.
On Mon, 21 May 2001 15:02:22 +0800, "Nicholas, Chua" NicholosC@maxis.net.my 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