home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 4.0 PR1
/
NeXT_NEXTSTEP_4.0_PR1_(beta).rar
/
Openstep4-Pr1User.iso
/
private
/
etc
/
uucp
/
UUAIDS
/
uurate
< prev
next >
Wrap
Text File
|
1995-09-02
|
983b
|
38 lines
case $# in
0)
FILE=/usr/spool/uucp/SYSLOG
;;
1)
FILE=$*
;;
*)
echo "usage: uustat [syslog]"
;;
esac
awk ' \
$5 ~ /received/ {ftotal++; fcount[$2]++; fbytes[$2] += $7; \
fsecs[$2] += $9} \
$5 ~ /sent/ {ttotal++; tcount[$2]++; tbytes[$2] += $7; \
tsecs[$2] += $9} \
{ curtime = substr($4, 5, 6); \
dtmp = curtime - int($9) - lasttime[$2]; \
if (dtmp > 0) if (dtmp < 20) \
dead[$2] += dtmp; \
lasttime[$2] = curtime; \
live[$2] += $9 ; \
} \
END { if (ftotal) for (i in fbytes) { \
printf "got from %8s %4d files %7d bytes %5d secs", i, \
fcount[i], fbytes[i], fsecs[i]; \
if (fsecs[i]) printf " %.2f bytes/sec", fbytes[i]/fsecs[i]; \
printf "\n"; } \
if (ttotal) for (i in tbytes) { \
printf "sent to %8s %4d files %7d bytes %5d secs", i, \
tcount[i], tbytes[i], tsecs[i]; \
if (tsecs[i]) printf " %.2f bytes/sec", tbytes[i]/tsecs[i]; \
printf "\n"; } \
for (i in live) { \
printf "%8s live%5d secs dead%5d secs\n", i, live[i], dead[i]; } \
}' \
$FILE