2

从 cron 运行时脚本出错

error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory

当我从命令行运行它时,我没有收到错误消息。

所以我确实在库上找到了命令并找到了它:

locate  - /export/home/orahome/11.2/lib/libclntsh.so.11.1

并将其添加到脚本中路径的末尾,但仍然出现错误。

#!/bin/bash
export PATH=/opt/OV/bin/OpC:/usr/local/sqlite3.6.23.1/bin:/production/java/jdk32  /bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/svn/bin:  /orahome/current/bin:/production/
fo/bin:/production/fo/scr:/production/fo/tools:/export/home/orahome/11.2/lib/

/production/bin/userStats -c /production/cfg/userStats.cfg > /production/log/userStats.log 2>&1

但仍然在日志中出现错误

casper@casperbox:> ls -ltr /production/log/userStats.log

-rw-r--r-- 1 casper casper 145 Oct 24 16:24 /production/log/userStats.log

casper@casperbox:> more /production/log/userStats.log

/production/bin/userStats: error while loading shared libraries: libclntsh.so.11.1: 
cannot open shared object file: No such file or directory
4

1 回答 1

2

您需要将其附加到LD_LIBRARY_PATH,而不是PATH

于 2013-10-24T20:45:26.983 回答