Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Runs fine on cmd line but not in cron

Runs fine on cmd line but not in cron

From: <yong321_at_yahoo.com>
Date: 2000/06/16
Message-ID: <8idse7$431$1@nnrp1.deja.com>#1/1

I understand a cron environment lacks a lot of environment variables. But this time I couldn't figure out. I already added most relevant variables to %ENV and it still only runs on command line but fails in cron: ORACLE_HOME, ORACLE_SID, TNS_ADMIN, TWO_TASK, LD_LIBRARY_PATH, even tried adding USER, LOGNAME, PATH etc. I also made sure @INC is the same inside cron environment as on command line. The user running this cron always gets this email after the cron is run:



Your "cron" job on indigopool
/usr/local/bin/perl /export/home/www/emailnotify.pl
> /export/home/www/output

produced the following output:

install_driver(Oracle) failed: Can't
load '/usr/local/lib/perl5/site_perl/sun4- solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: /usr/local/bin/perl: fatal: libclntsh.so.8.0: open failed: No such file or directory at /usr/local/lib/perl5/sun4- solaris/5.00404/DynaLoader.pm line 166.

 at (eval 6) line 2

 at /export/home/www/emailnotify.pl line 22


The file libclntsh.so.8.0 and its symlink libclntsh.so are both in LD_LIBRARY_PATH. Permission is set to readable. What's more, the perl script (for this cron job) does NOT die on this line (which is line 22):

die "Can't connect to DB!" unless ($dbh=DBI->connect ("dbi:Oracle:STGFNDO8","iptest","thepassword",RaiseError=>0,AutoCommit=> 0,PrintError=>1}));

because I don't see the "Can't connect" message printed and I can see my "print"ed strings below this line for debugging.

I spent too much time trying to figure out and gave up. What could I be missing? Can anyone help? Thanks a lot.

--
Yong Huang

(yong321_at_yahoo.com)


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Jun 16 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US