[lug] cron question

Walter Pienciak walter at frii.com
Tue Oct 24 15:16:23 MDT 2000

On Tue, 24 Oct 2000, Michael Wegener wrote:

> Hello everybody,
> Is there any reason why cron might be picky about what it chooses to
> run? I run cron as root with a mixture of scripts (which run fine) and
> PATH-resident commands (i.e. echo and sitecopy). All show up in the cron
> logs, but "sitecopy" and "echo" never run  and I can't figure out why
> there should be a difference. Any ideas what I'm missing?


Your $PATH is not what cron uses when it runs.  So even though a file
may be in your $PATH, there's no guarantee it's in cron's $PATH.

And that goes for shell builtins too -- the echo builtin in your $SHELL
may not do the same thing as the echo builtin in cron's $SHELL (probably
/bin/sh).  It's easier to force use of the "real" echo by using the
full pathname of the version with the behavior you prefer (/usr/bin/echo,
/usr/ucb/echo, ...)

Summary: Either use full pathnames for your executables or man cron to
see which file you can set cron's environment from, so they *are* in
cron's $PATH.  The first is a lot easier.  The second is a good thing to


More information about the LUG mailing list