Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need your help to run a bash script in crontab. As many other posts in askubuntu I'm facing the problem that a script that is properly running in terminal mode does not run in crontab. The error I get is:

/usr/local/rams60/build/fdgrib2/fdgrib2: error while loading shared libraries: libhdf5.so.8: cannot open shared object file: No such file or directory

Cron output also shows TERM environment variable not set.

but of course libhdf5.so.8 exists:

lrwxrwxrwx 1 root root 16 ene 20 12:54 /usr/local/hdf5/lib/libhdf5.so.8 -> libhdf5.so.8.0.1

I found some posts about similar issues like

Reasons why crontab does not work

http://stackoverflow.com/questions/5064518/shell-script-and-cron-problems?rq=1

Following that posts I set PATH in my script adding both /usr/local/rams60/build/fdgrib2/ and /usr/local/hdf5/lib/

For sure I am missing some simple setting but I can't see where.

Thanks in advance for your help

share|improve this question
1  
Try sudo ln -s /usr/local/hdf5/lib/libhdf5.so.8 /usr/local/lib, sudo ln -s /usr/local/hdf5/lib/libhdf5.so.8 /usr/lib. That's the general way for adding something inside PATH. –  Danatela Mar 11 at 9:52

1 Answer 1

up vote 2 down vote accepted

Try

sudo ln -s /usr/local/hdf5/lib/libhdf5.so.8 /usr/local/lib/
sudo ln -s /usr/local/hdf5/lib/libhdf5.so.8 /usr/lib/

That's the general way for adding something inside PATH.

Also, for check, use

ldd /usr/local/rams60/build/fdgrib2/fdgrib2

This command will show what's missing in your libraries.

share|improve this answer
    
It works!! Thank you very much –  pacomet Mar 11 at 10:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.