how many blocks are how old?

Ron Natalie <ron> ron at brl-tgr.ARPA
Tue Jan 29 03:45:42 AEST 1985


> 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 }"



More information about the Comp.unix.wizards mailing list