#!/usr/bin/ksh
#----subtract 15 minutes (900 seconds) from time
STAMP=$(perl -e '($ss, $mm, $hh, $DD, $MM, $YY) = localtime(time() - 900);
printf "%04d%02d%02d%02d%02d", $YY + 1900, $MM + 1, $DD, $hh, $mm')
#----create an empty file with a timestamp of 15 minutes ago
touch $STAMP /tmp/flagfile
#----find newer files
find /start/dir -type f -name '*.out' -newer /tmp/flagfile -print |\
while read FILE
do
#----search the file for the word "error"
if grep -q "error" $FILE
then
echo $FILE found, send an email to a data center operator
fi
done