Setting environment variuables
Hi
I've written a Java program, which connects to an Oracle database, and run some queries. The problem is, it can not find the OCI library which is located in ${ORACLE_HOME}/lib, so I need to set an environment variable like this: Code:
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib |
Checkout the file "/etc/crontab". Inside you will find the PATH settings for all the cronjobs. Try if the java programm runs if you fill in the enviorment variable.
If this doesn't work just make a little wrapper script for cron. Code:
!#/bin/bash Regards Zhjim |
Unfortunately, it doesn't work. When I run application from command line, it works great. But when it comes to cron, it doesn't work, just because LD_LIBRARY_PATH doesn't set correctly...
|
Ok. Did you try the wrapper script? Maybe it's not the LD_LIBRARY env var alone?
|
Can u share u r cron script
or else u can make entries of export LD_LIBRARY........... in u r script, which will eventually set LD_LIBRARY when the script runs. ex:- vim /oracle/test.sh LD_LIBRARY_PATH=xyz export LD_LIBRARY_PATH ur required commands crontab -e 00 02 * * * sh /oracle/test.sh i hope this helps |
Quote:
Is there a difference in permissions cli vs. cron? perhaps you are root in one instance and user in the other? |
All times are GMT -5. The time now is 11:51 PM. |