关于Oracle的R脚本crontab错误

时间:2015-04-09 05:28:23

标签: r

我比较新但我真的得到一个问题:我有一个R脚本放在crontab中并得到一个错误,但我可以在命令行中运行脚本。错误是:



Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/usr/lib64/RRO-8.0.1/R-3.1.2/lib64/R/library/ROracle/libs/ROracle.so':
  libclntsh.so.10.1: cannot open shared object file: No such file or directory
Loading required package: plyr
Loading required package: lubridate

Attaching package: 'lubridate'

The following object is masked from 'package:plyr':

    here

Loading required package: mailR
Error: Couldn't find driver Oracle. Looked in:
* global namespace
* in package called Oracle
* in package called ROracle




一些提示将非常感谢

1 个答案:

答案 0 :(得分:0)

我在crontab中运行时遇到了同样的错误,因为在通过crontab运行时没有正确设置所有env变量。您可以在r脚本之前在crontab中定义变量ORACLE_HOME,LD_LIBRARY_PATH,PATH,或者只是使用shell包装器来调用r脚本。默认情况下,所有env变量都在shell中正确读取和设置,您可以从那里调用r scipt。