Path And 'cron'
Tim Daneliuk
tundra at tundraware.com
Tue Feb 21 07:25:17 PST 2006
Warren Block wrote:
> On Mon, 20 Feb 2006, Tim Daneliuk wrote:
>
>> In case you're interested (or anyone else listening), it seems that
>> 'chown' likes to live in /usr/sbin - i.e., A place not in the default
>> path. As it happens, a root cron task is trying to run a script
>> that uses 'chown' and is thus failing. I can change the PATH just
>> for root's crontab and solve the problem. I was just curious if there
>> was a way to more broadly modify the defaults used by cron.
>
>
> The standard solution would be to use a full path to the command in the
> script (/usr/sbin/chown). If it's used in multiple locations, defining
> it as a shell variable makes it maintainable:
>
> CHOWN="/usr/sbin/chown"
>
> ${CHOWN} somefile
> ...
> ${CHOWN} anotherfile
>
> -Warren Block * Rapid City, South Dakota USA
The problem in this case is that it is not a shell script I own
or maintain - it is the shell script provided with 'nessus' to update
its plugins. I could certainly modify the script, but then I'd have
to remember to do this every time I upgraded the program. I prefer
"fire and forget" solutions that take care of themselves automatically.
Hence my desire to be able to change the default path cron uses in
some config file....
--
----------------------------------------------------------------------------
Tim Daneliuk tundra at tundraware.com
PGP Key: http://www.tundraware.com/PGP/
More information about the freebsd-questions
mailing list