1

We need /usr/local/bin in cron's path! this way: http://discuss.joyent.com/viewtopic.php?pid=213759 didnt work for us.

grosser
  • 277
  • 4
  • 8
  • 3
    There are many variants of cron, and sometimes more than one within a given distribution. Can you provide more details (distribution, where you're adding the cron that's failing, etc.)? – BMDan Jul 16 '10 at 12:37

1 Answers1

3

If you are using Red Hat Enterprise Linux or derivative distributions of it, you can do it by following the "Configuring Cron Tasks" section of Red Hat's manual for RHEL. You will be editing /etc/crontab and modifying the PATH variable to add /usr/local/bin.

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
runlevelsix
  • 2,619
  • 22
  • 20
  • does not work on ubuntu, even after restarting cron (only works when used directly in the crontab of the user) – grosser Jul 19 '10 at 07:02
  • What user is running the cron job? Can you just updated the PATH variable in the crontab of the user running it? According to https://help.ubuntu.com/community/CronHowto, "Depending on the commands being run, you may need to expand the root users PATH variable" by updating PATH variable at the top of the root user's crontab file. Additionally, http://gaarai.com/2009/03/18/changing-when-daily-cron-jobs-run-in-ubuntu/ indicates that /etc/crontab is a system-wide crontab. I'm not much of an Ubuntu user though, so if that does not help, I apologize. – runlevelsix Jul 19 '10 at 13:22