Warn user of HDERR (hard disk errors) in /usr/adm/unix.log
Lenny Tropiano
lenny at icus.islp.ny.us
Mon Nov 7 11:24:21 AEST 1988
The comments will explain it all...
-- cut here -- -- cut here -- -- cut here -- -- cut here -- -- cut here --
#
# Notify user of HARD DISK errors from /usr/adm/unix.log daily.
#
# By Lenny Tropiano
# ICUS Software Systems (...icus!lenny, lenny at icus.islp.ny.us)
#
# Place in /usr/lib/crontab:
#
# 59 23 * * * /bin/su root % /usr/lbin/errnotify.sh > /dev/null
#
DATE="`date | cut -c5-10`"
grep "${DATE}" /usr/adm/unix.log | grep "HDERR" > /tmp/$$hderr
#
# See if there are any errors tonight.
#
set `wc /tmp/$$hderr`
LINES=$1
CHRS=$3
if [ ${CHRS} -ne 0 ]
then
echo "${LINES} hard disk errors occurred on ${DATE}" > /dev/error
cat /tmp/$$hderr > /dev/error
fi
rm -f /tmp/$$hderr
--
Lenny Tropiano ICUS Software Systems [w] +1 (516) 582-5525
lenny at icus.islp.ny.us Telex; 154232428 ICUS [h] +1 (516) 968-8576
{talcott,decuac,boulder,hombre,pacbell,sbcs}!icus!lenny attmail!icus!lenny
ICUS Software Systems -- PO Box 1; Islip Terrace, NY 11752
More information about the Unix-pc.sources
mailing list