Why does a shell script fail in crontab?

Ralf Luebeck rl at laura.UUCP
Tue Oct 18 19:44:35 AEST 1988


In article <287 at lakart.UUCP> dg at lakart.UUCP (David Goodenough) writes:
>I have a shell script ( /usr/local/dopath ) that has the job of updating
>our UUCP map files every day at 7:00 AM. There is only one problem with it:
>when it runs from crontab it produces a zero size Index file, yet when I
>run it by hand from a uid 0 shell it succedes, and generates the correct
>Index file. Here is the crontab entry:
>
>0 7 * * *	root	/usr/local/dopath
>
>and here is the contents of that same file:
>[...deleted...]
>/usr/local/unshar -c * 2>&1 >/dev/null
>/usr/local/getcon /usr/spool/news/news/config/* >d.Temp
>/usr/local/pathalias u.[A-Z]* d.* u.[a-z]* 2>/dev/null | \
>    /usr/local/pathfilt | sort -u > UUPATH

David, I don't know what your local commands do, but I know, that commands
like 'su' fail as cronjob, when they call ttyname(3) or try to open(2)
"/dev/tty" or something else, 'cause cronjobs don't have a tty.
Hope this helps...

>	dg at lakart.UUCP - David Goodenough
ciao,
	Ralf

-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
-  |>  |  .. |       |  	rl at unido.uucp (...seismo!unido!rl)
-  |\. |_ \/ |> <- < |< 	rl at unido.bitnet
-  -  -  -  -  - Computer Science Department (IRB) -  -  -  -  -  -  -
- University of Dortmund-  - P.O. Box 500500 -  - D-4600 Dortmund 50 -



More information about the Comp.unix.questions mailing list