Bugzilla – Bug 404154
Cron does not invoke folder /usr/local/bin (only /usr/bin)
Last modified: 2008-07-17 15:47:15 UTC
Pre-note: This occurs with openSUSE 10.1 (on a V-Server), but I think this probably would also happen with 10.x and 11.0! If so, this should be fixed in v11. The original version of Python was 2.4.2, too old for me. So I installed Python 2.5.2 by using 'make'. If I am typing "python -V" it shows me 2.5.2. If I create a shell script containing "python -V" it also shows me 2.5.2. But if I add that script to my cronjobs, it will output 2.4.2! Oddly, the file "/usr/bin/python2.4" is used then! Why does "python" use/link to "python2.4" instead of "python2.5" if run by cron? Directly running "python2.5" or "/usr/local/bin/python" works though ;-)
Oh, stating "python2.5" does not work either with cron. The reason is that cron only uses /usr/bin/python(2.4) (but not /usr/local/bin/python(2.5))! Shouldn't cron be allowed to use also /usr/local/bin versions?
No, the default path is intentionally restricted. But you can set the PATH environment variable in your crontab, for example to PATH=/usr/local/bin:/usr/bin:/bin