[lug] cron shell debian

Gary Hodges Gary.Hodges at noaa.gov
Tue Aug 16 16:22:33 MDT 2005


Warren Sanders wrote:
> Gary Hodges wrote:
>
>> I have a sarge install where a shell script works if I run it from
>> the command line, but doesn't when run as a cron job.  It has
>> #!/bin/sh as the first line.  If I put absolute paths in the shell
>> script it works.  How can I change this globally, rather than using
>> explicit paths in the script?
>>
>
> Yes this is one way as one of the first lines in your crontab:
> PATH=/usr/local/sbin:/usr/bin:/bin

Thanks for all the suggestions!  The one above that was suggested a
couple times is working for me.  As a policy, is it better to set the
PATH within the script rather than in the crontab?

Gary



More information about the LUG mailing list