Why does a shell script fail in crontab?

Henry Spencer henry at utzoo.uucp
Sun Oct 23 11:09:03 AEST 1988


The three things to look for when a program runs fine manually but
won't run from cron are:

1. Does it rely on any environment variables being set?  For example,
	we had some (binary-only, grr) typesetting software that refused
	to run if the HOME variable wasn't set.  Don't ask me why.

2. Does it rely on a non-standard (not /bin:/usr/bin) PATH?  Shell scripts
	in particular should *ALWAYS ALWAYS ALWAYS* set PATH first thing,
	if only to guarantee that they aren't getting the user's funny
	private versions of commands.  Don't forget to export the new PATH.

3. Does it rely on umask being non-zero?
-- 
The meek can have the Earth;    |    Henry Spencer at U of Toronto Zoology
the rest of us have other plans.|uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.unix.wizards mailing list