Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site megad.UUCP Path: utzoo!linus!philabs!sbcs!megad!seth From: seth@megad.UUCP (Seth H Zirin) Newsgroups: net.unix-wizards Subject: Re: Running C programs with cron ??? Message-ID: <200@megad.UUCP> Date: Wed, 2-Oct-85 09:57:22 EDT Article-I.D.: megad.200 Posted: Wed Oct 2 09:57:22 1985 Date-Received: Mon, 7-Oct-85 06:43:50 EDT References: <21900005@orstcs.UUCP> Organization: The Bohemian Pleasure Dome Lines: 25 > Has anyone experienced problems with the 'system()' call within a C > program not being executed properly when the program is executed via > cron? ..... > The C program contains a line such as.. > system("/usr/lib/uucp/uucico -r1 -sxxxxxx"); > > 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. Cron doesn't set up the environment completely enough for your commands to execute. The uucico command likes to have LOGNAME set appropriately, and "ps" probably would work a litte better if you used "ps -ef" or "ps -alx" (depending on the flavor Unix you use). Its common practice to call commands with an "su" from cron: 30 5 * * 1 /bin/su uucp -c "/usr/lib/uucp/uudemon.wk > /dev/null" -- ------------------------------------------------------------------------------- Name: Seth H Zirin UUCP: {decvax, ihnp4}!philabs!sbcs!megad!seth Keeper of the News for megad