You must put the full paths in your crontab . This is the safest option.
If you do not want to do this, you can put a script wrapper around your programs and set PATH there.
eg.
01 01 * * * command
becomes:
01 01 * * * /full/path/to/command
Also, everything that is called from cron should be very careful about running programs and probably set its own choice for the PATH variable.
EDIT:
If you donโt know where the command you want to execute which <command> from your shell, and it will tell you the path.
EDIT2:
So, once your program is running, the first thing it should do is set PATH and any other required variable (e.g. LD_LIBRARY_PATH ) for the values โโneeded to run the script.
Basically, instead of thinking about how to change the cron environment to make it more suitable for your program / script, make your script a processed environment specified by the appropriate parameter at startup.
Douglas Leeder Mar 05 '10 at 16:08 2010-03-05 16:08
source share