[comp.unix.questions] Is there any way of setting up search path for cron?

chiang@odin.m2c.org (Rit Chiang) (03/08/89)

I am setting up a script command in crontab.  Now the script contains
a few other command in /usr/local/bin.  However, these commands are
not absolutely specified in the script.  The run got aborted due to
the fact that cron cannot execute the commands.  My question is whether
there is any way to specify a search path for cron (similar to set path
command in the .cshrc file).

Thanks for any response.

							Rit
Rit Chiang		     | UUCP:{harvard, ulowell}!m2c!chiang
Mass. Microelectronis Center | Internet: chiang@m2c.m2c.org
75 North Dr.,		     | CSNET: chiang%m2c.org@relay.cs.net
Westboro, MA 01581           | (508)870-0312 X222   [FAX (508)898-2275]

nobody@tekecs.GWD.TEK.COM (-for inetd server command) (03/09/89)

In article <4536@m2c.M2C.ORG> chiang@odin.m2c.org (Rit Chiang) writes:

>I am setting up a script command in crontab.  Now the script contains
>a few other command in /usr/local/bin.  However, these commands are
>not absolutely specified in the script.  The run got aborted due to
>the fact that cron cannot execute the commands.  My question is whether
>there is any way to specify a search path for cron (similar to set path
>command in the .cshrc file).

The easiest and probably most correct way is to set the PATH variable in
your script.  Then, in your crontab put the entire path to the script.
(This is not a bad idea in any case for the security-conscience type :-)

IE:  In a /bin/sh script add:

PATH=/bin:/usr/bin:/usr/local/bin

export PATH

	-Jeff
--
Jeff Beadles
jeff@quark.WV.TEK.COM