Why crontab is not able to run some commands ?
Paul Schmehl
pauls at utdallas.edu
Fri May 11 20:03:17 UTC 2007
--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.
--
Paul Schmehl (pauls at utdallas.edu)
Senior Information Security Analyst
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/
More information about the freebsd-questions
mailing list