Script Works, But Not with CRON
Brian K. White
brian at aljex.com
Wed May 5 08:47:26 PDT 2004
Bob Stockler wrote:
> On Wed, May 05, 2004 at 12:18:33AM -0400, Ken Brody wrote:
>> Bob Stockler wrote:
>> [...]
>>> TERM=ansi ; PFTERM=ansi ; PFPROG=/u/appl ; PFDATA=/u ; PFDIR=""
>>> [...] But, surprise of surprises, "script.err" held:
>>>
>>> *** A System Error Has Occurred ***
>>> /pcfiles2/filepro/invtry/keyx1: Permission denied
>>>
>>> Standard Input Redirected
>> [...]
>>> I don't know where it got "/pcfiles2" (that's a directory
>>> in the root filesystem where Windows users store their PC
>>> files) for $PFDATA$PFDIR or where "keyx1" came from.
>>>
>>> Back to the drawing board tomorrow.
>>
>> Is "/pcfiles2" a mounted filesystem? (Type "/etc/mount".)
>>
>> Is PFDSK set for normal logins? I see that you don't set it in the
>> cron script.
>
> I think maybe you and Keith Weatherhead have detected my
> oversight. PFDSK is set to "/u" in the environment for
> all regular users, but 'cron' isn't a regular user.
>
> Its absence in the script would explain why it works from
> the command line, but not when run by 'cron'- that being
> the significant difference in the environment in which it
> runs under those two conditions.
>
> I'll set it in the script and see what happens tonight.
>
> Thanks all . . .
>
> Bob (kicking himself in the head over that oversight)
If you install oss642a (or if you have open server 5.0.7 or later)
then you can set environment variables in /etc/default/cron that are in
effect for all cron jobs.
I typically just set PATH=lots-of-stuff and TERM=ansi
and don't set any PF variables, relying on a correct /etc/default/fppath and
fp config file for the main fp installation and environment setting start
scripts for any settings that need to deviate from the main unqualified
system.
So I have a single installation of fp binaries
and some different environments, some that consist of whole seperate filepro
trees with menus, config, prt files, filepro directory etc... and some where
the only difference is a pfqual.
In either case, I use fp only via a start script that sets whatever
over-riding variables are necessary and then either runs the command given
on the command line, or starts a new shell "in" that environment.
user login processes and cron jobs and top level fp "qualifier" menus all
have commands that look like:
# part of a top level menu
1: company aaa
aaa p main
# cron job
20 2 * * * bbb rreport journal -f maint ...
# last line of a users .profile
exec ccc p main
# or as a programmer, just sitting at a command prompt
ddd
which changes the PS1 promt to
DDD System #
now all commands you run are in the ddd environment until you type exit or
switch to some other environment via another start script
I don't set any PF variables in /etc/profile or .profile, just fppath and fp
config files and "environment" start scripts.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
More information about the Filepro-list
mailing list