Xref: utzoo comp.unix.questions:9826 comp.unix.wizards:11829 Path: utzoo!attcan!uunet!mcvax!unido!laura!rl From: rl@laura.UUCP (Ralf Luebeck) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Why does a shell script fail in crontab? Message-ID: <656@laura.UUCP> Date: 18 Oct 88 09:44:35 GMT References: <287@lakart.UUCP> Reply-To: rl@unido.UUCP (Ralf Luebeck) Organization: University of Dortmund, W-Germany Lines: 30 In article <287@lakart.UUCP> dg@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@lakart.UUCP - David Goodenough ciao, Ralf - - - - - - - - - - - - - - - - - - - - - - - - - |> | .. | | rl@unido.uucp (...seismo!unido!rl) - |\. |_ \/ |> <- < |< rl@unido.bitnet - - - - - - Computer Science Department (IRB) - - - - - - - - University of Dortmund- - P.O. Box 500500 - - D-4600 Dortmund 50 -