From owner-freebsd-questions@FreeBSD.ORG Tue Oct 7 09:32:27 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 853701065688 for ; Tue, 7 Oct 2008 09:32:27 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA02.emeryville.ca.mail.comcast.net (qmta02.emeryville.ca.mail.comcast.net [76.96.30.24]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3748FC2D for ; Tue, 7 Oct 2008 09:32:27 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA08.emeryville.ca.mail.comcast.net ([76.96.30.12]) by QMTA02.emeryville.ca.mail.comcast.net with comcast id Pl7H1a00A0FhH24A2lYTNP; Tue, 07 Oct 2008 09:32:27 +0000 Received: from koitsu.dyndns.org ([69.181.141.110]) by OMTA08.emeryville.ca.mail.comcast.net with comcast id PlYS1a0092P6wsM8UlYSp7; Tue, 07 Oct 2008 09:32:26 +0000 X-Authority-Analysis: v=1.0 c=1 a=ESj1TDIVQCsA:10 a=IjFfP5vsGDcA:10 a=QycZ5dHgAAAA:8 a=7WhpFyW4ZQ5IIfwUSG4A:9 a=EZ4-eNBnxVkAuUqzbOsA:7 a=qd5X19CdS4xneQt_YyfXio9VpSsA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id 270C2C9419; Tue, 7 Oct 2008 02:32:26 -0700 (PDT) Date: Tue, 7 Oct 2008 02:32:26 -0700 From: Jeremy Chadwick To: Marc Coyles Message-ID: <20081007093226.GA44366@icarus.home.lan> References: <003001c9285d$f2a3a410$d7eaec30$@wakefield.sch.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003001c9285d$f2a3a410$d7eaec30$@wakefield.sch.uk> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-questions@freebsd.org Subject: Re: Script works fine from CLI, but not when Cron'd 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, 07 Oct 2008 09:32:27 -0000 On Tue, Oct 07, 2008 at 10:20:32AM +0100, Marc Coyles wrote: > I've got a script to backup my MySQL databases, which works absolutely > fine from the command line, but when I add it in to root's cronjobs it > always fails with "mysqldump: not found" - what am I doing wrong? mysqldump is in /usr/local/bin, which $PATH does not contain when running from a cronjob. (PATH inside of cron has a very limited scope, I believe it's /bin:/usr/bin). Either set PATH to include /usr/local/bin, or just refer to the fully-qualified path of mysqldump (/usr/local/bin/mysqldump). -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |