i have a ksh script that creates messages in a temp directory and then sends them out using the sendmail command and i'm trying to set it up to run every night with crontab.
So the basic gist of the script is
#create temp dir and messages
...
#loop through each message and send using sendmail
ls $dateFolder/Group/* | \
while read tempMsg
do
cat $tempMsg | /usr/lib/sendmail -t
done
When I run the script from the command line in my home directory it works perfectly, but then when I edit my crontab file with something like:
48 23 * * *
/home/users/campbelr/ddts_reminder.ksh /home/users/campbelr/ddts_reminder_config.txt
the temp directory and files are created, but the sendmail command does not execute. I'm an unix shell scripting newbie, so i don't understand how this could happen. is it an environment difference? any ideas?