Script works fine from CLI, but not when Cron'd

Olivier Nicole on at cs.ait.ac.th
Wed Oct 8 04:17:01 UTC 2008


> > 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


More information about the freebsd-questions mailing list