Reputation: 1
When I'm running a python script from crontab it is throwing me the below error:
Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory
But when I'm running the script manually its working fine. Issue is only when the job is running from crontab at the scheduled.
Upvotes: 0
Views: 1440
Reputation: 4471
Cron does not know anything about your shell. Before you fire off your python script, you need to source inn all relevant environment information in order for the libraries to locate the different pieces. (Note the dot! in front of $HOME)
0 5 * * * . $HOME/.bash_profile; /path/to/my/awesome/python_script.py
Make sure export LD_LIBRARY_PATH=/path/to/my/oracle/<version>/client64
is exported accordingly.
Best of luck!
Upvotes: 2