Have a box which has 10 jobs. The box is scheduled to run everyday after every 1 hour say at 9, 10, 11... There are no conditions on any jobs within the box nor on the box.
When the last job fails say at 9:30, the box becomes failed.
When one of the middle job fails say at 9:30, the box remains in running state.
Now at the next run time comes ie 10:
In case of last job failure, the box restarts at 10.
In case of mid job failure, the box doesn't restart.
In case of last job failure, I want the box not to restart at 10 as we want the whole box to be completed or wait for someone to fix the last job.
How can I do that? Is there a way to put a condition on box that it starts only when last run of the box is success. Would the condition success(box_name) be appropriate? Please help. Let me know in case the issue is not clear.
In that case create a 11th job in main box with job_type: b and sleep_interval: 60
and change success condition of main box to success(job11).
Make job11 as dependent to job10, where job 11 runs after success(Job10).
If job10 fails, work on the failure and needs to trigger job11 for the mainbox to succeed.
Related
I have a chain with several jobs, and sometimes a certain job that normally takes about 2 hours, finishes in less than 2 minutes.
What I would like to do is to kill this job if it ends in less than 2 minutes so that the chain won't proceed.
Is this possible?
Thanks
Well you don't really want to kill anything, do you? If you do, see BMC's note (including video) on using ctmkilljob.
In this case your next job is dependent on 2 things, the predecessor job being ok and the duration of the predecessor job. Add another input condition to your next job (in addition to the existing condition) to represent the >2 minutes duration.
On the job that needs to run for more than 2 minutes, add a Notify when the Exectime exceeds 2 mins (or 60 mins or whatever you decide is the threshold) and get it to shout to an entry in your shout destination table.
On the Control-M Server create a new program entry in your shout destination table and create a small script referenced by the shout. The script should use the ctmcontb utility to create a new ODAT condition that your next is waiting on. If you have a look at the BMC help note for ctmkilljob (and just substitute in ctmcontb) then you'll see how to do this.
I am having BOX-A which is having BOX-A1, BOX-B1 and BOX-C1. Each boxes are having multiple jobs. Here my doubt is Once I start the BOX-A, first it should trigger BOX-A1 and it should complete all of its jobs and also should wait for 5 min. After the successful completion of BOX-A1 jobs then BOX-B1 should trigger, same way it should trigger all of the jobs and should wait for 5 min then BOX-C1 trigger. Can anyone Pls provide the Jil script for this?
Thanks in Advance
Sherin Pooja
Not sure if an option is present at Autosys level.
But hoping the jobs are bash scripts.
To the first jobs of both BOX-B1 and BOX-C1 boxes, at the first line or before the actual command add a sleep command
sleep 300 # 5 mins in seconds
the script would be paused for 5 mins before it begins processing the net lines.
Hope this helps.
What is the difference of putting job on hold and putting it on ice?
There are two notable differences between ON HOLD and ON ICE jobs, which dictate when to use them. When an ON_HOLD job is put off hold, it runs, if it's starting conditions are satisfied, while an ON ICE job will not run, after putting into OFF ICE, even if it's starting conditions are met. It will only run, when it's starting condition will reoccur. For example, if you have a job which starts your Java services at 3.00 A.M., which was ON_HOLD, it will run as soon as you make OFF_HOLD and starting condition met, while in the case of ON ICE, it will only run on next day. Another critical difference between ON_ICE and ON_HOLD comes in terms of dependent jobs. All dependent jobs of an ON_ICE job will execute as though ON_ICE job was succeeded while all dependent jobs of an ON_HOLD job will not run until that job is put on OFF hold. This is the most important difference between them. In the case of box jobs, suppose you have 4 jobs inside a box jobs, and 3rd job depends upon the success of the 2nd job, which was put ON ICE, then when that box job is started, both first job and the 3rd job will start immediately because ON ICE makes the dependent job to run immediately.
Summary:
1 Dependent jobs of ON_HOLD doesn't run, but dependent jobs of ON_ICE runs as it succeeded.
2 An ON_ICE job doesn't run, when it puts OFF ICE and starting condition met while ON_HOLD jobs run when you put it OFF HOLD and it's starting conditions met (you can change its state to INACTIVE if this is undesirable).
3 Dependent jobs of ON_ICE jobs, which is inside a box job, will run immediately once box job is started.
Read more: http://javarevisited.blogspot.com/2013/08/difference-between-on-hold-and-on-ice-jobs-autosys-interview-question.html#ixzz4q7iBbf8Y
I have a box which has its own start time and starting conditions on other boxes. Say the box has a start time of 5:30 and has condition like s(a, 30)&s(b, 22)&s(c)
What will happen at 5:30 if all the conditions are not met?
Will the box trigger ever, when the conditions are met even after 5:30?
Box will stay INACTIVE until ALL the conditions (no matter date or starting) become true.
So at 5:30 it will be still INACTIVE if any of conditions is not met.
And yes, box will trigger when the conditions are met even after 5:30.
It looks like the jobs A and B have look back times set on them (that's the part after the name of the job and the comma), this will alter the behavior as outlined by the previous answer.
At 5:30a the box will kick off only if job A has reached success state within the previous 30 minutes and job B has reached success within the last 22 minutes. C must also be in success but with no specific look back interval.
If 5:30a comes around and job A went into success at 4:45a (more than 30 mins earlier) the box will not kick off. Same with job B at 22 minutes. If 5:30a comes around and job A and C are in success with job B still running (or in success from 22+ minutes earlier) the box will not kick off. If 6:01a comes around and job B goes into success the box will not run because the last success of A was 30+ minutes prior.
I hope this makes sense. I should add that I usually recommend against using a specific lookback time in favor of using a 0 lookback. This translates roughly as 'since the last time that I was used to kick you off'... But that being said, there are definitely cases where a specific lookback is appropriate. Without more information it's hard to determine if that is true in your case.
Box will stay INACTIVE until ALL off the conditions met.
So at 5:30 it will be still INACTIVE if any of conditions is not met.
And yes, box will trigger when the conditions are met even after 5:30.
And all job in Box will be in INACTIVE state, if job is independent to box and it met all conditions then this job be in running state.
I have an Autosys box and there is a couple of jobs inside it.
For example, MY_BOX is the name of the box and it has the jobs JOB_1 and JOB_2.
I would like to configure the box in such a way that it runs continuously. (i.e.) as soon as the JOB_2 completes (success or failure), MY_BOX should start running again. Could you please tell me how to configure this?
I tried setting the "run condition" for MY_BOX as SUCCESS(JOB_2), however, the Box does not start after the completeion of JOB_2.
I'm not exactly sure how to make MY_BOX run immediately after the success of JOB_2, but you could set the interval on which MY_BOX runs to just about (or a little bit more) than the average run of MY_BOX.
I.E. - if MY_BOX runs for about 10 minutes, have MY_BOX run every ten/eleven minutes. Or try setting it's condition to the SUCCESS(MY_BOX).
You can also give the condition as done(MY_BOX) to the MY_BOX as you want the MY_BOX to run immediately irrespective of the success or failure of JOB_2.
If the JOB_2 fails then the MY_BOX also fails then the condition success(MY_BOX) will not make the MY_BOX to run. So if you give the condition as done(MY_BOX),irrespective of the success or failure of MY_BOX, the MY_BOX will start running immediately.