Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2006 07:51:00 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Tim Daneliuk <tundra@tundraware.com>
Cc:        freebsd-questions@freebsd.org, Randy Pratt <bsd-unix@comcast.net>
Subject:   Re: Path And 'cron'
Message-ID:  <20060221074639.H49013@wonkity.com>
In-Reply-To: <43FA88EB.9020103@tundraware.com>
References:  <43F8E25D.5030503@tundraware.com> <20060219164805.0de1772d.bsd-unix@comcast.net> <43F9EC82.80609@tundraware.com> <20060220194218.27f2f710.bsd-unix@comcast.net> <43FA88EB.9020103@tundraware.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060221074639.H49013>