🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.sysadmin
Article #1574

Re: 3.0: what gives with cron

#1574
From: Steve Hayman
Date: Mon, 28 Sep 1992 05:17
39 lines
1905 bytes
>I'll bet you're piping your backup data to rsh, eh?  Sorry, bunkie; rsh in 3.0
>does not work under cron.  I spent several hours on this problem and fairly
>conclusively proved that rsh just dies silently when it is run under cron.


One possibility is that it could be a problem with $PATH.  If you add
something like this to /etc/crontab

	* * * * * root echo path is $PATH >/dev/console

and then look at the message in the console window, you'll see that
cron is using "/etc:/usr/etc:/bin:/usr/bin" as a default PATH.  Note the 
conspicuous abscence of "/usr/ucb", home of rsh, finger and many other programs.
So cron won't find those programs uness you go out of your way to
give it a better PATH.  I.e. crontab lines like this

	* * * * * root rsh somewhere blah blah

will fail silently.

You could fix this in 2 ways - the obvious way is to hard code the
pathname you want ...

	* * * * * root /usr/ucb/rsh somewhere blah blah

or, alternatively, if you're trying to execute a shell script,
you can add "PATH=/usr/local/bin:/usr/ucb:/bin:/usr/bin export PATH"
to the script you're executing.  (Setting the PATH explicitly is a good
idea for scripts in general.)

Also alternatively you could get the Paul Vixie public domain
cron replacement program, which has many useful features not found
in the standard cron.

Hope this helps someone.
Steve

-- 
Steve Hayman          Systems Engineer, NeXT Canada      Steve_Hayman@NeXT.com
Technical Details
Message-ID: <1992Sep28.001755.801@news.cs.indiana.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!rutgers!news.cs.indiana.edu!sahayman@moose.cs.indiana.edu
References: <MS-C.717540884.662824084.mrc@Tomobiki-Cho.CAC.Washington.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!rutgers!news.cs.indiana.edu!sahayman@moose.cs.indiana.edu
From: sahayman@moose.cs.indiana.edu (Steve Hayman)
Newsgroups: comp.sys.next.sysadmin
Subject: Re: 3.0: what gives with cron
Message-ID: <1992Sep28.001755.801@news.cs.indiana.edu>
Date: 28 Sep 92 05:17:38 GMT
References: <MS-C.717540884.662824084.mrc@Tomobiki-Cho.CAC.Washington.EDU>
Organization: NeXT Canada
Lines: 39