I have a script that greps the /var/adm/messages file for a pattern, write
it to a file. Then emails me a warning.
The thing is I want to run this regularly, and the messages file is not
rotated regularly. How do I add this to the script that I only want it to
grep the file and email me if there is a new "pattern" not the same
"pattern" from an hour ago, or yesterday.
grep "currently marked as unusable" $ADMSG > $TEMP
grep "No more IP addresses on 192.168.2.0 network" $ADMSG >> $TEMP
if [ -s $TEMP ]
/usr/sbin/pntadm -P 192.168.2 >> $TEMP
#rm -f $TEMP
Yes, a will be installing a logchecker, but for now this is what I have time