Question regarding the cron

Hi,

We have developed the script which will send an (html)attachment in through mail. The stand alone script is working fine ,but when we schedule it cron the "nail" command is not working that is we are not receving any mail.
Following is the command which we used to send the mail. :confused:

/usr/bin/nail -s "Reports generation mail" -a Units.html -a Hundreds.html abc@xyz.com < /dev/null 

In the cron the script is schedule everyday. Following is the cron entry:

00 09 *  *  * /home/admt/common/script/Report_generation.ksh >> /home/data/dev2/log/Report.log

Why the "nail" command is not working in cron... :eek:
I also tried to use "mailx" command but its also not working.. :mad:
Can anybody help me regarding the same??

Thanks In Advance!!

If the script is working when you, you execute it, that means you have something more in your environment cron is missing...
Have you tried to schedule under your own account? I would give a try and add as first line to the script

. $HOME/.profile

and see if it works now ($HOME may need to be substituted to the proper value...)

The answer is always always the same: something not set in ENV.

If you think it really is cron, see Cron is not working

Otherwise, a very easy test is to try it with "at". If that works, it's absolutely an environment variable not set in cron. See Cron, Batch and At for suggestions on fixing that.

As a minimum this script will need a "cd" to wherever the files "Units.html" and "Hundreds.html" reside.

When you say "not working" please post any error messages. In this case the error messages will be in the unix mail for the account who owns the cron.

Personally I would take all processing out of cron totally (including >> redirection) and do the whole lot in the shell script under a controlled environment with a shebang line at the start of the script. Obviously still invoking the shell script from cron.

Thanks all for the reply!!!

Actually I just included the "vbe" command in the script and it worked.. :smiley: :smiley:

. $HOME/.profile

Thanks again !! :wink: