I am working in Redhat
and have few programs located in folder /usr/local/bin
I would like to call from crontab
for root
user.
I thought that by putting binaries in that folder would be sufficient to call the program directly as in the shell.
Essentially I need to specifiy the folder everytime so the crontab below doesn't work
5 9 * * 1,2,3,4,5 my_bin some_args
but I change it into
5 9 * * 1,2,3,4,5 source ~/.bashrc; /usr/local/bin/my_bin some_args
Do you know why?
The reason why I sourced bashrc
was to add some environment libraries, in particular LD_LIBRARY_PATH
as my binary couldn't find some shared libraries from /usr/local/lib
.
chmod +x
).