[Dirvish] Utility to show incremental usage per image within a vault

Steve Leung sjleung at shaw.ca
Fri May 5 21:44:22 UTC 2006


On Fri, May 05, 2006 at 04:20:48PM -0500, Matthew Pressly wrote:
> 
> I think it could be done in a perl script using 'stat' calls, which
> will return the file size and inode number (which could be used to avoid
> counting multiple hard links to a file more than once across the vaults),
> but I think it would be slow, and I would like to avoid re-inventing that
> wheel, if it already exists.

Doesn't 'du' already try to keep track of inodes and only report 
hard-linked files once?  For example, if I run this on my home directory 
in my dirvish vault, it looks like this:

% du -sm */tree/home/steve
50802   20060420/tree/home/steve
595     20060421/tree/home/steve
20      20060422/tree/home/steve
561     20060423/tree/home/steve
197     20060424/tree/home/steve
21      20060425/tree/home/steve
467     20060426/tree/home/steve
1373    20060427/tree/home/steve
1180    20060428/tree/home/steve
27      20060429/tree/home/steve
1927    20060430/tree/home/steve
833     20060501/tree/home/steve
1394    20060502/tree/home/steve
641     20060503/tree/home/steve
251     20060504/tree/home/steve

Of course, on a big backup vault this could take an awfully long time.

And if you want them going backwards, some combination of 'find -type d 
-maxdepth 1' and 'sort -r' will probably net you a shell script to do 
this work.

Steve


More information about the Dirvish mailing list