Mods to tee...Uses for awk
Matt Crawford
matt at oddjob.UChicago.UUCP
Wed Jan 23 05:29:11 AEST 1985
Here's a script which we run twice a week from crontab. It used to
use du(1) instead of the 4.2 quot(8). No flames about not having
used sh, please -- I wrote this before I knew any better.
#! /bin/csh -f
# Script to notify heavy disk users of their sins
# Change the constant at the beginning of the awk command as needed.
#
/etc/quot -f /dev/rra0f | \
grep -v 'root' | \
awk '$1 > 10000 { printf "mail %s << EOM\n", $3 ;\
printf "Your %d files on /oa are using %d KB.\n",$2,$1;\
printf "This makes you the number %d disk-hog.\n",NR;\
printf "EOM\n" ; }' | \
csh -sf
More information about the Comp.sources.unix
mailing list