Path: utzoo!utgpu!watmath!uunet!labrea!rutgers!tut.cis.ohio-state.edu!osu-cis!att!icus!lenny From: lenny@icus.islp.ny.us (Lenny Tropiano) Newsgroups: unix-pc.sources Subject: Warn user of HDERR (hard disk errors) in /usr/adm/unix.log Keywords: HDERR, unix.log, errors, /dev/error, icons Message-ID: <539@icus.islp.ny.us> Date: 7 Nov 88 01:24:21 GMT Distribution: unix-pc Organization: ICUS Software Systems, Islip, New York Lines: 33 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@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@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