Why crontab is not able to run some commands ?

Duane Hill d.hill at yournetplus.com
Fri May 11 20:10:55 UTC 2007


On Fri, 11 May 2007, Paul Schmehl wrote:

> --On Friday, May 11, 2007 19:45:22 +0000 Duane Hill <d.hill at yournetplus.com> 
> wrote:
>
>> On Fri, 11 May 2007, Paul Schmehl wrote:
>> 
>>> 
>>> Then try running this in your cron job:
>>> /bin/sh /etc/scriptfile
>>> 
>>> Bet it does work.  :-)
>> 
>> Yes, but if the OP has:
>> 
>> # !/bin/sh
>> 
>> as the first line, the file owned by root and the executable flag for
>> user set, shouldn't it execute from cron as just:
>> 
>> /etc/scriptfile
>> 
>> ??
>> 
> Yes, but I always like cron jobs to specifically call absolute path to the 
> binary of choice.  That way someone couldn't substitute a different binary by 
> altering the path and force a cron job to do something unexpected.

True. Thanks for the tip.


More information about the freebsd-questions mailing list