Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!houxm!whuxlm!harpo!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!ron From: ron@brl-tgr.ARPA (Ron Natalie ) Newsgroups: net.wanted,net.unix-wizards Subject: Re: how many blocks are how old? Message-ID: <7780@brl-tgr.ARPA> Date: Mon, 28-Jan-85 12:45:42 EST Article-I.D.: brl-tgr.7780 Posted: Mon Jan 28 12:45:42 1985 Date-Received: Wed, 30-Jan-85 06:04:00 EST References: <297@pertec.UUCP> Distribution: net Organization: Ballistic Research Lab Lines: 20 Xref: watmath net.wanted:5665 net.unix-wizards:11774 > Does anyone have any sort of utility that can be used on a filesystem > to give you a run-down on file/block aging? I'd like to be able to > run it on, say, /usr/spool, to let me know how many blocks are one day > old, two days old, 30 days old, etc. > if [ -z "$1" ] then echo Usage: ager days [dir] exit 1 fi if [ $2x = x ] then DIR="." else DIR="$2" fi find "$DIR" -atime +$1 -exec ls -sd {} \; | awk \ "BEGIN { sum = 0 } \ { sum += \$1 } \ END { print sum }"