Page 1 of 2

Unix Script for restartability

Posted: Thu Nov 03, 2011 11:29 am
by pandeesh
Hi,

I have a sequence which has 5 job activity stages.
I need to run the sequence using unix script.
I am not using checkpoints in sequence.
i want to handle the restartability in unix scripts.

Any suggestions welcome.

Thanks.

Posted: Thu Nov 03, 2011 12:52 pm
by ray.wurlod
Use the dsjob command. Restartability will take care of itself.

Posted: Thu Nov 03, 2011 1:02 pm
by pandeesh
Thanks Ray!!

Do you mean using DSJOB without the -mode RESET switch?

Thanks

Posted: Thu Nov 03, 2011 1:12 pm
by chulett
No. Since you've said there are no checkpoints involved, you will need to RESET the job if it aborted on the previous run.

Posted: Thu Nov 03, 2011 1:16 pm
by pandeesh
Yes. I agree that the job needs to be reset before the run.
But the script is going to trigger the main sequence.
so, i believe there is no need of resetting the sequence.
if we reset the job sequence, it will start the first job in stead of the aborted job.
Please correct me ,if i am wrong.
Thanks

Posted: Thu Nov 03, 2011 1:32 pm
by ray.wurlod
If you're not using checkpoints then the job (sequence) status will never be "restartable". Therefore if it aborts, it will need to be reset. But a top-level sequence should be written so that it never aborts.

Re: Unix Script for restartability

Posted: Thu Nov 03, 2011 1:36 pm
by chulett
pandeesh wrote:I am not using checkpoints in sequence.
What happened to this part? (emphasis mine)

Posted: Thu Nov 03, 2011 1:53 pm
by pandeesh
Ok fine.Due to lack of checkpoints,the sequence needs to be reset.
But how DSJOB will track the aborted job in the sequence and start running from there?
If the sequence is reset, then it will start a fresh run.

But i want to start from where it aborts in the last run.
At the same time, there should not be any checkpoints in sequence.

Thanks

Posted: Thu Nov 03, 2011 4:06 pm
by ray.wurlod
It won't. You need checkpoints for that.

Or you can create the same logic in your sequence. Before every activity check whether (a) the sequence failed to finish successfully and (b) whether that activity finished successfully and, based on those results, make the decision whether to invoke the activity.

Why bother? Enable checkpoints.

Posted: Thu Nov 03, 2011 6:35 pm
by chulett
pandeesh wrote:i want to start from where it aborts in the last run.
At the same time, there should not be any checkpoints in sequence.
Those are mutually exclusive requirements, unless for some reason you want to play the "roll your own" game. As noted, why bother? Enable checkpoints.

Be curious to hear your counter-point, why the "should not be any" requirement is on the table.

Posted: Thu Nov 03, 2011 7:01 pm
by pandeesh
chulett wrote:Be curious to hear your counter-point, why the "should not be any" requirement is on the table.
Craig,
The above is not clear.
Can you please explain?

Thanks

Posted: Thu Nov 03, 2011 8:03 pm
by jwiles
I thought it was pretty clear. You have stated:
But i want to start from where it aborts in the last run.
At the same time, there should not be any checkpoints in sequence.
Why can't checkpoints be used?

Posted: Thu Nov 03, 2011 10:06 pm
by pandeesh
The simplest way is adding checkpoints in sequence and using sahib without -mode reset switch .
But I am curious ,whether we can implement the restart ability in unix script without using checkpoints.
But it's pretty clear that implementing a generic script is complex.
But if we know the number and types of stages in sequence ,
Then we can implement job sequence specific script in our own way.
I will try Jon sequence specific script and let you know.
Thanks

Posted: Thu Nov 03, 2011 11:05 pm
by chulett
pandeesh wrote:But if we know the number and types of stages in sequence ,
Then we can implement job sequence specific script in our own way.
The above is not clear.
Can you please explain?

OK, a little good natured tease but honestly - I have no idea what a "job sequence specific script" could possibly be. How do you imagine you can change where a sequence job without checkpoints restarts from outside of it using a shell script? :?

Posted: Thu Nov 03, 2011 11:11 pm
by pandeesh
I got your point Craig.
What i meant was creating a shell script as an alternative to sequence,
Actually the script is not going to trigger the sequence but the individual jobs which called in the sequence,
In this case there's no need of job sequence.
Whatever we are going to implement in sequence, we will do that in script level .
I will try this script.

Thanks