axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Perry2 <>
Subject Re: Problem with cronjob
Date Wed, 15 Sep 2004 08:01:30 GMT

None of the system profiles get read when a script is executed by cron, but
they do when you log in and run the script. This means that any environment
variables set in the script need to be explicitly set, e.g. $HOME_DIR. If
this is set in the /etc/profile or $HOME/.profile, ~/.basrc, or whatever
shell profile script you are using then it won't be set.

I find it best to have a common env script which can be loaded by my
.profile and a cron script. e.g. in the cron script add '.
/path/to/script/myEnv' to the top of the script.

Andrew Perry
Clients for Web Service Stack
Mail Point 127
IBM UK Laboratories. Hursley Park, Winchester, Hants. SO21 2JN
Tel. Internal 249828  External + 44 (0)1962 819828
Fax. + 44(0)1962 818080

             damitha kumarage                                              
   >                                                     To 
             10/09/2004 11:35                                           cc 
             Please respond to         Problem with cronjob                
              "Apache AXIS C                                               
             Developers List"                                              

In the autobuild script after building and sending I'm trying to send a
mail attached with the result reports.

Following is a snippet from it

if test -f $HOME_DIR/mailto; then
    cat  $HOME_DIR/testcases/build/runTestCase.log | mutt -s
"[test-results]Axis C++ Autobuild and regression test" -a
"$HOME_DIR/testcases/build/buildTestCase.log" -x

As you can see I'm using the mutt MUA to send a mail with attachment to
the  axis-c-dev mailing list. mutt is on the path and exported inside
the script.

My problem is when I run this script from the command line it works
perfectly well and send the mail to the mailing list.

But when the cronjob run everything in the script works fine except
sending the mail

Does any body have any idea why this so happen?

thanks in advance

View raw message