Working on a script to look in a directory for a certain file. If the file is not there, check the time. If the time is greater than 10:00, send me an email. If it's not, sleep for 15 minutes and then do this all over again.
I can get it to email me if the file's not there without the sleep portion. Once I add the sleep, it appears to be working (I run the script and it waits until 10:00 to bring the command prompt back), but it doesn't send an email.
What am I doing wrong?
Here's the snippet of code:
if [ ! -s $DATA_DIR/test2.das ]
then
now=`date +'%H%M'`
if test $now -gt 1000
then
/usr/bin/echo $MESG_DELAY | /usr/bin/mailx -s $MESG_DELAY
here@there.com
else
sleep 900
fi