I have a problem where scripts called by cron have very short, safe, path: /usr/bin:/bin
I know, that I can:
- Change scripts to use better path
- in user crontab add PATH=... configuration
But I'd like to be able to tell crond that on this system all crons should be called with PATH=...
I tried putting it in /etc/crontab:
=# grep PATH /etc/crontab
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
And then, for tests, I wrote:
=# cat /etc/cron.d/test
* * * * * test echo "$( date ) - ${PATH}" >> /tmp/test.cron.log
But logged path is still "/usr/bin:/bin"
I did restart crond, and even rebooted, just in case, but it doesn't seem to help. What am I missing? Or is it impossible?