[Dirvish] examining disk space usage per image...need script or rsync parameter

Jason Boxman jasonb at edseek.com
Fri Dec 30 13:08:33 EST 2005


Paul Slootman said:
<snip>
> sub wanted {
>     my ($dev,$ino,$mode,$nlink,$uid,$gid);
>
>     if ((($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && (-f _) &&
> ($nlink == 1)) {
>         $totalblocks += int(((-s _) + 4095) / 4096); # round up
>     }
> }

Oops.  Forgot about the obvious links output from `stat`.  Nevermind most of
my reply...





More information about the Dirvish mailing list