On a related question, anyone know of a script or tool that can do this for nfs ? We have a few non-netapp nfs systems hosting archives (~330TB auto-mounted into a single namespace), that we would like to gather age distribution stats. On the windows side we use TreeSize, but it doesn't scale beyond 20TB. Doing that over samba is very slow.
Sorry to hijack your post. -sto
Hi folks,
If anyone is interested I wrote a "Find" class in ruby with all of the features of the Unix "find" command and a few more:
1) access to parent directory chain
2) save/accumulate information during the find
3) post-process a directory after traversing it
4) terminate traversal at any time
5) supports multiple processes or Ruby threads
Probably doesn't work on Windows, only Unix.
The standard Ruby "find" is pretty rudimentary. It consumes TONs of memory if run in a large directory tree (breadth-first search) and it returns file pathnames as strings.
My find uses depth first search (only needs memory for the current item and the parent directory chain) and it returns a "Find" object with many useful methods, including "stat" information via Ruby's File::Stat class.
Here is a simple Ruby script that implements Unix "du -k" with my Find class:
Usage: du.rb dir ...
===========cut======== #! /usr/bin/ruby
include("./find.rb") # file not included in this email
top = Find.new
# register callback code to run after traversing a directory
top.postprocess do |dir| printf(dir[:total] / 2, " ", dir.path, "\n")
# add our total to our parent directory
dir.parent[:total] += dir[:total] if dir.parent end
# Run the find, which passes a "Find" object to the # block of code for each item in the directory tree
top.find(ARGV) do |f|
# This is a netapp, so we avoid .snapshot folders
if f.name == ".snapshot" f.prune next end
# accumulate disk usage (512 byte blocks)
if f.stat.directory? f[:total] = f.stat.blocks elsif f.parent f.parent[:total] += f.stat.blocks end end =============cut=======
On Thu, Dec 6, 2012 at 10:38 AM, Kawakubo, Ken kkawakub@fhcrc.org wrote:
Dear List,
I am trying to get file size and age distribution stats per volume on a Ontap8.1 system. Apparently, "filestats" command was removed on Ontap8.1 as "filestats" relies on java and java was removed on 8.1.
Does anybody know of any quick ways to get this kind of stats on 8.1?
Regards,
Ken Kawakubo Seattle
Toasters mailing list Toasters@teaparty.net http://www.teaparty.net/mailman/listinfo/toasters
Steve Losen scl@virginia.edu phone: 434-924-0640
University of Virginia ITC Unix Support