Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

user crontab

Status
Not open for further replies.

swa75

Technical User
Aug 20, 2002
14
0
0
FR
I want to execute a script(1) in a user crontab.

My problem is that this script(1) contains other scripts that are in different directories.

when i execute the script(1) manually it works well but through the cron it can't find the different paths.

The different scripts can be executed from anywhere and by anyone.

Is there something to configure?
 
Hi, because cron doesn't have it's own environment variables, you need to tell it explicitly what the PATH variable should be. Put this in your script (PATH=<paths to directories>) and export it and hopefully this will solve your problem.
 
hi,
you have to set the PATH environment variable up in your script because cron doesn't do this . In your script use full paths to run your scripts.
If you don't specify what shell you are using cron will use
sh shell by default i.e. at the top of your script have an entry #!/bin/ksh (sh,etc...)

hth
 
Hi,

is impossible for us understand the correct cause.

What I can suggest is to call, from user crontab,
a debug script that creates files. eg:

myscript.ksh
------------
#!/bin/ksh

set
pwd
echo &quot;path=$PATH&quot;
echo &quot;user=$USER&quot;
.....
and other command that can help you to define envs.


then in crontab use

* * * /mydir/myscript.ksh 1>/tmp/x.out 2>/tmp/x.err


After execution, check the mail of the user: also there
you can find answer to your problem.

b y e .
 
the message I get is :

exec(): 0509-036 Cannot load program RTSBBASE because of the following errors:
0509-150 Dependent module libcobrts.2.so could not be loaded.
0509-022 Cannot load module libcobrts.2.so.
0509-026 System error: A file or directory in the path name does not exist.


my script exacutes an other script that executes RTSBBASE. At the beginning RTSBBASE was not found but i made a &quot;cd /path&quot; in my script to solve this problem.

But RTSBBASE is also a script that searchs the file libcobrts.2.so which is not in the same directory than RTSBBASE and i can't do another &quot;cd /.....&quot;.

But I think these files should be executed without having to specify the path because when i execute my script manually it works.

I've put the PATH environment variable in my script but it changes nothing.
 
To get the COBOL run-time system to work, you also need to set the environment variable LIBPATH which should point to the libraries of your COBOL software

e.g.

export LIBPATH=/usr/lib/cobol

or whereever.

Hope that helps,
LHLTech

IBM Certified Specialist - AIX System Support
Halfway through CATE exams!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top