From owner-freebsd-questions@FreeBSD.ORG Wed Oct 8 04:17:01 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 564CE106568B for ; Wed, 8 Oct 2008 04:17:01 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.freebsd.org (Postfix) with ESMTP id 13C0A8FC15 for ; Wed, 8 Oct 2008 04:16:57 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) by mail.cs.ait.ac.th (8.13.1/8.13.1) with ESMTP id m979XiLp008416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Oct 2008 16:33:45 +0700 (ICT) (envelope-from on@banyan.cs.ait.ac.th) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.14.2/8.12.11) id m979c30l096572; Tue, 7 Oct 2008 16:38:03 +0700 (ICT) Date: Tue, 7 Oct 2008 16:38:03 +0700 (ICT) Message-Id: <200810070938.m979c30l096572@banyan.cs.ait.ac.th> From: Olivier Nicole To: mcoyles@horbury.wakefield.sch.uk, freebsd-questions@freebsd.org In-reply-to: <720051dc0810070228o68f0a67bx8cab7869ace8269f@mail.gmail.com> (jamesoff@gmail.com) References: <003001c9285d$f2a3a410$d7eaec30$@wakefield.sch.uk> <720051dc0810070228o68f0a67bx8cab7869ace8269f@mail.gmail.com> X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Cc: 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: Wed, 08 Oct 2008 04:17:01 -0000 > > 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? > > Things started from cron inherit a different PATH. Either add the > appropriate directories to PATH or specify the full path to mysqldump. In a script aimed to be run by cron, try to always use full path to the commands. It's the safest solution. Olivier