It is currently 25 May 2019 8:08


Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 25 Mar 2019 10:04 
Offline
Nouveau
Nouveau
User avatar

Joined: 10 Jan 2007 12:00
Posts: 185
Location: Zagreb, Croatia
Hello all,
we are facing the following problems with running Control-M jobs on AIX machine, Control-M version 9.x
1. If we define job as "Command", ev-JOberything works fine. The syntax of command is: cd /app/t1/ppt && ./batch/JOB01
No Pre-execution command is used.

2. If we define job as Script, the syntax is:
File path: /app/t1/ppt/batch
File name: JOB01

EVerything works fine until JOB01 starts to execute outer script (job) - JOB02 - which is defined inside script of JOB01 as the following:
EXEC batch
./batch/JOB02.sh
JOB02 successfully started but fails, because it can't find directories needed to execute script. The developers used relatzive paths in all their scripts and there is no way to change that.
After JOB02 started to execute (it started from JOB01 script), it fails with error: can't find directories.

As I said in first scenario, JOB01 successfully started JOB02 from inside script/program, and JOB02 finish OK, that means that JOB01 also finish OK. But that works only if we use COmmand in job definition.
But we wants to use Scripts in job definition because this give us more flexibility.

Any ideas how to successfully execute JOB02 (it started OK, but fails to find folders because of relative paths) without using absolute paths in development?

Thanks in advance,
Igor


Top
   
PostPosted: 26 Mar 2019 9:16 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Apr 2005 12:00
Posts: 732
Location: PARIS
Hi Igor

Hope your are well ;-)
Only way I can suggest is :
Is JOB1 script, set a variable reading local path as with pwd command.
And add this variable in ./batch/JOB02.sh command as for instance (in ksh):

PATHLOC=$( cd -P -- "$(dirname -- "$(command -v -- "$0")")" && pwd -P )
./batch/JOB02.sh ${PATHLOC}


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved