A Cron Issue

Hi Guys.,,

This thing is driving me crazy..

I have this script which runs perfectly fine. If it is not able to connect to database it will drop a mail which it does when i ran it manually.

But when i am running it from crontab, the script is not sending mail to me but to my id(login id) in the box. In that log, am able to see that the mailx command ran still i am not able to get any mails for it..

Can you guys tell me where i am overlooking.

I am pasting the log i got from my mailbox (unix).

Your "cron" job executed on fcrd02 on Mon Feb  8 04:25:00 EST 2010
/clocal/fastcar/user/fcfmetl/Unix_Scripts/trigger_execTVGen.ksh > /clocal/fastcar/user/fcfmetl/crontlog/trigger_execTVGen.log


produced the following output:

+ msg=SCRIPT: /clocal/fastcar/user/fcfmetl/Unix_Scripts/trigger_execTVGen.ksh\nexecTVGen Trigger: No data to be processed Will wait for 5 minutes\nDATE: Mon Feb  8 04:25:02 EST 2010
+ sub=execTVGen Trigger will wait for 5 mins
+ body=
+ var=2
+ echo No of variables: 2
+ [[ 2 -eq 3 ]]
+ hostname
+ date
+ mail -s /clocal/fastcar/user/fcfmetl/Unix_Scripts/trigger_execTVGen.ksh - execTVGen Trigger will wait for 5 mins um26@xxx.com
+ echo SCRIPT: /clocal/fastcar/user/fcfmetl/Unix_Scripts/trigger_execTVGen.ksh\nexecTVGen Trigger: No data to be processed Will wait for 5 minutes\nDATE: Mon Feb  8 04:25:02 EST 2010\n\nServer : fcrd02\nSent on : Mon Feb  8 04:25:02 EST 2010\nScript : Email


*****************************************************************
        cron: The previous message is the standard output
        and standard error of one of the cron commands.

---------- Post updated at 03:44 PM ---------- Previous update was at 03:02 PM ----------

Guys.. the issue was not with cron command.. but with the mail command

 echo "$msg\n\nServer : `hostname`\nSent on : `date`\nScript : Email" | mail -s "$0 - $sub" "$NotifyList"

The "-" was causing a problem..i replaced it with :

Still i am just wondering how the script ran fine when i ran it manually??