Is it possible to use environment variables within cron jobs. I am using a cron job to run a c program at regular intervals. The C program uses a library and i have set the library path in the LD_LIBRARY_PATH environment variable. But when i ran the job i got the error library not found!! Any suggestions!!
You need to create a script that sets the variable and runs your program, like:
* * * * * /usr/local/bin/myscript
cat myscript
export LD_LIBRARY_PATH=/your/library/path
/usr/local/bin/myCprogram