things like:

export ORACLE_HOME=$ORACLE_BASE/orahome
export TNS_ADMIN=$ORACLE_HOME/network/admin

try running the following script in your browser and see what variables are there that
are not in your default environment.
try running the same thing from cron, (take out the CGI specific stuff of course) to
see the default environment.

#!/usr/bin/perl -w
use CGI qw{:standard};
print start_html;
foreach (keys %ENV)
        {
        print "$_ = $ENV{$_} <br>\n";
        }
print end_html;

Oh, one other thing....are you using Apache::DBI when running on the webserver? If yes,
this needs to be changed to just DBI on the command line/cron, and I THINK it means
that DBI may need to be installed separately.  Try "perl -MDBI -e'1'" to see if it is
actually installed.

jeff


[EMAIL PROTECTED] wrote:

> On Wed, 08 Aug 2001 12:51:53 -0400, Jeff Seger
> <[EMAIL PROTECTED]>,[EMAIL PROTECTED]
> wrote:
>
> >>There are three things to take into account here....environment, environment,
> >>environment.
> >>Your cron job needs to have the same environment as the web server.
> >>
> >>something like this:
> >>
> >>02 8 * * *  . /dw/prod/DW/Load/config/dw-env.sh; /dw/prod/DW/Load/scripts/daily.pl
> >>
> >>where /dw/prod/DW/Load/config/dw-env.sh  contains the environment variables.
>
> Jeff,
>
> What exactly env variables need to be contain in the .sh shell script, this is
> abit beyond me here.. not fimilar with shell scripts too much.
>
> Plus the problem arises by just executing the script at the command line, and
> not even with a cronjob:
>
> % perl -c script_name.pl
>
> if I execute the script(check syntax), from the command line, I get the Error,
> DBI.pm module not found, if I execute the script from the browser, it works
> perfectly!!
>
> Mike(mickalo)Blezien
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Thunder Rain Internet Publishing
> Providing Internet Solutions that work!
> http://www.thunder-rain.com
> Tel: 1(225)686-2002
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Reply via email to