Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Oct 2008 16:38:03 +0700 (ICT)
From:      Olivier Nicole <on@cs.ait.ac.th>
To:        mcoyles@horbury.wakefield.sch.uk, freebsd-questions@freebsd.org
Subject:   Re: Script works fine from CLI, but not when Cron'd
Message-ID:  <200810070938.m979c30l096572@banyan.cs.ait.ac.th>
In-Reply-To: <720051dc0810070228o68f0a67bx8cab7869ace8269f@mail.gmail.com> (jamesoff@gmail.com)
References:  <003001c9285d$f2a3a410$d7eaec30$@wakefield.sch.uk> <720051dc0810070228o68f0a67bx8cab7869ace8269f@mail.gmail.com>

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



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