# Weighted average summary of file size + age

**URL:** <https://www.ruby-forum.com/t/weighted-average-summary-of-file-size-age/134102>\
**Category:** Ruby\
**Created:** [April 7, 2008, 9:56pm UTC](https://www.ruby-forum.com/t/weighted-average-summary-of-file-size-age/134102 "2008-04-07T21:56:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bil\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/848f3c/32.png) [@Bil\_K](https://www.ruby-forum.com/u/Bil_K)\
**Post date:** [April 7, 2008, 9:56pm UTC](https://www.ruby-forum.com/t/weighted-average-summary-of-file-size-age/134102/1 "2008-04-07T21:56:00Z")

</div>

Hi,

Do any system admins have a utility lying around to  
compute some sort of weighted average summary of  
file size and age?

Our cluster home space needs some cleaning and I suspect  
some of the files folks are keeping on there are quite old  
and would like to drive the point home with more than  
just a `du -h /users/*` listing.

So something like,

User Usage Hog score

kleb 102GB 195 19.9GB-Kdays  
frank 56GB 32 1.8GB-Kdays  
hamly 354GB 454 160.7GB-Kdays

where is the average age in days, something like,

sum( file.size \* file.age ) / ( total\_size \* total\_age )

and Hog Score is Usage x in GB-kilodays.

Later,
