[net.unix-wizards] how many blocks are how old?

bytebug@pertec.UUCP (roger long) (01/28/85)

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.

Something that gave other statistics of interest might be useful as well.
-- 
	roger long
	pertec computer corp
	{ucbvax!unisoft | scgvaxd | trwrb | felix}!pertec!bytebug

ron@brl-tgr.ARPA (Ron Natalie <ron>) (01/28/85)

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

acheng@uiucdcs.UUCP (01/29/85)

>/* ---------- "how many blocks are how old?" ---------- */
>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.
>
>Something that gave other statistics of interest might be useful as well.
>-- 

In 4.2, there is an undocumented (at least not in our version) option, -v,
in /etc/quot that will give you 3 more columns of blocks for files not
accessed 30+, 60+, 90+ days.  The "quot" lists them out by uid and it
makes life easy for system people to locate "disk hogs" and/or "idle hogs".
Of course, the user may turn around and touch all his files but we still
assume we are in a friendly, cooperative environment.
One of our gurus modified the "du" to give a similar but more general
feature of disk blocks not accessed by *directories*.  This one would be
helpful for users to locate his idle files.  We may post it if there is a big
demand for it.