From owner-freebsd-questions@FreeBSD.ORG Tue Feb 21 14:51:03 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A74B16A420 for ; Tue, 21 Feb 2006 14:51:03 +0000 (GMT) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB86A43D45 for ; Tue, 21 Feb 2006 14:51:02 +0000 (GMT) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.13.3/8.13.3) with ESMTP id k1LEp0Ma063038; Tue, 21 Feb 2006 07:51:00 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.13.3/8.13.3/Submit) with ESMTP id k1LEp0Fq063035; Tue, 21 Feb 2006 07:51:00 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Tue, 21 Feb 2006 07:51:00 -0700 (MST) From: Warren Block To: Tim Daneliuk In-Reply-To: <43FA88EB.9020103@tundraware.com> Message-ID: <20060221074639.H49013@wonkity.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> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (wonkity.com [127.0.0.1]); Tue, 21 Feb 2006 07:51:00 -0700 (MST) Cc: freebsd-questions@freebsd.org, Randy Pratt Subject: Re: Path And 'cron' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2006 14:51:03 -0000 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