Page 1 of 1

Autosys JOB is not waiting for the Shell Script to complete

Posted: Sat Nov 15, 2014 6:20 pm
by dgokulakrishnan
Dear Team -

We are using Datastage to load Netezza Tables. After the load completes using a UNIX Shell script to copy certain tables data from One database to another Database.

And we plan to schedule a autosys JOB to invoke the Shell script but whenever we test the Autosys JOB it completes less than 60 seconds and it affects the Shell Script execution as well.

When I execute the Shell Script alone it works perfectly.

Can you please help to resolve this issue.

Posted: Sat Nov 15, 2014 11:58 pm
by chulett
A little lost. :?

Is this actually a DataStage question or are you simply having a problem using Autosys to run a shell script? For the latter I'm going to give you some standard advice for shell scripts, especially for ones that 'work perfectly' when run manually but fail in some fashion when run under automation.

Make no assumptions in the script. Set / source any environment variables you need. Don't assume you know what the Current Working Directory is if you are using relative paths, 'cd' where you need to be for paths to work properly. Etc etc.

If you need more help, please be more specific with regards to the nature of the issues you are facing. For example, saying "it affects the Shell Script execution" doesn't really help us help you. Affects it how? In what way?

Posted: Sun Nov 16, 2014 6:36 pm
by dgokulakrishnan
This question is w.r.to Autosys & Shell Script.

Script has to copy around 50 tables from one DB to other DB.

Autosys JOB completes less than 60 seconds hence the script also aborts before it copy all the 50 tables to other DB.

sometimes it copies 5 to 10 tables only.

Posted: Sun Nov 16, 2014 6:53 pm
by ray.wurlod
Use a DataStage sequence to control which tables get copied.

Start only the sequence from the third party scheduler (Autosys).

Much cleaner.

Posted: Sun Nov 16, 2014 9:13 pm
by chulett
So... not a DataStage issue or question. Probably better to ask this on an Autosys support forum. Regardless, my previous reply still stands - there's obviously something incorrect in your script if it only works correctly when run manually.

Posted: Mon Nov 17, 2014 2:46 pm
by kduke
Are you using -wait option?

Posted: Mon Nov 17, 2014 4:13 pm
by chulett
I don't believe there is a DataStage component to this and thus no use of dsjob... best I can tell, anywho.

Posted: Thu Nov 20, 2014 9:48 pm
by kduke
I understand you Craig but now I am lost as to what the question is.

Posted: Thu Nov 20, 2014 10:08 pm
by chulett
You are not alone, my friend.

Re: Autosys JOB is not waiting for the Shell Script to compl

Posted: Thu Dec 04, 2014 2:07 pm
by bikramkumar.sahu@yahoo.co
If your main script (script triggered by the Autosys job) is triggering multiple subscripts independently then you might face this issue where Autosys job will not wait for the script to complete. Try to use datastage or if you are not using Datastage then use one single script.