1

I wrote a shell script to run svn, as following:

#! /bin/sh
cd /data/tmpsvn/
export LC_ALL=zh_CN.utf8
date "+getSvn - [%Y-%m-%d %T]" >>svn.log 2>&1
/usr/local/bin/svn checkout http://IP >> svn.log 2>&1

Then I wrote a crontab:

*/5 * * * * sh /data/htdocs/zlbz-test/tools/get_svn_all.sh 1>/dev/null 2>&1

Some errors occur like this shown in log file:

getSvn - [2015-05-12 14:40:01]
/usr/local/bin/svn: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

but when I execute this command in terminal, it work well.

Can any people explain what has happened?


It's been solve according to Vadim Landa's link in the comment. I added a line in the script:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/openssl/lib/
Cœur
  • 37,241
  • 25
  • 195
  • 267
Jason Pan
  • 702
  • 7
  • 21

1 Answers1

0

Most probably, the LD_LIBRARY_PATH variable is only set in your shell profile, but not in the crontab. Check out this thread: Python cannot find shared library in cron

Community
  • 1
  • 1
Vadim Landa
  • 2,784
  • 5
  • 23
  • 33