Running C programs with cron ???

kmn kmn at orstcs.UUCP
Sat Sep 21 04:36:00 AEST 1985


Has anyone experienced problems with the 'system()' call within a C
program not being executed properly when the program is executed via
cron?  I have an Intel 286/310 XENIX system (but have also seen the
problem on a VAX running 4.2).

The problem is as follows:

The C program contains a line such as..

	system("/usr/lib/uucp/uucico -r1 -sxxxxxx");

The program executes correctly when executed in the csh, but if the
program is executed via cron with 0 * * * * /usr/lib/uucp/program
the system command is not executed.  All other statements in the C
program execute properly.

I have had similar problems by doing the following test:

create a shell containing:

	ps > /tmp/junk

then execute the shell with cron by * * * * * csh shell

The ps command never dumps to the file /tmp/junk.


I suspect that the problem is in executing a new shell from within cron,
and possibly due to the differences between sh and csh, but I haven't
been able to figure it out (although, uucico executes properly from
both sh and csh).

Any answers would be greatly appreciated.  Please respond to:

		Dave Wills
		Oregon State University
		...hplabs!hp-pcd!osuee!dave



More information about the Comp.unix.wizards mailing list