10
1
We need to have /usr/local/bin in cron's path for all users. Is there a way to set it system-wide, without needing to edit each individual user's crontab?
We've tried adding PATH to /etc/crontab:
# grep PATH /etc/crontab
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
But when users have this in their crontab:
$ crontab -l | grep PATH
* * * * * echo $PATH > /tmp/current_cron_path
...it reveals that their path is still set to default:
$ cat /tmp/current_cron_path
/usr/bin:/bin
2General hint: Writing "it didn't work" will not usually get you a useful reply. Always describe how exactly it didn't work, that is, exactly what did you do, and what exactly was the result. – sleske – 2010-07-19T10:14:14.833
Please note that relying on
– Der Hochstapler – 2012-06-12T15:07:21.217echo
in your cron is possibly unreliable.