Hi my script is as below.
#! /bin/sh
get=`ls -l *.ZIP | egrep -c '^-'`
put=`cat Get_File_Count.txt|grep '[0-9]'`
if [ $get -gt $put ]
then
echo $get > Get_File_Count.txt
echo "Hi,\n\nYou've got a new feed!\n\nFilename : `ls -l *.ZIP|sort -k 6|tail -1|cut -c 58-90`" | mail -s "New File Received" user@domain.com
else
echo "No new File"
fi
When i run the script it is running perfectly.
I included the above script in crontab.
MAILTO="user@domain.com"
30 * * * * /usr/informatica/test/infa_shared/SrcFiles/Get_New.sh >/dev/null 2>&1
But i am not getting any mail and also the script is not executing every 30 minutes 