lenny@icus.islp.ny.us (Lenny Tropiano) (11/07/88)
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