CA Workload Automation ESP Edition

Expand all | Collapse all

Run window behavior inside Box Job

  • 1.  Run window behavior inside Box Job

    Posted 09-06-2015 02:19 PM

    Hi All,

     

    I have a scenario to schedule a job execute in below condition.

     

    BOX to start at 14:00 on Mo, Tu, We, Th, Fr calendars

    Job 1 to run at 01 AM next day (Tu,We,Th,fr,sa)

    Job 2 to run at 17 PM same day (Mo, Tu, We, Th, Fr calendars)

     

    I have setup like this,


    insert_job: BOX1          job_type: box         
    days_of_week: mo,tu,we,th,fr          start_times: "14:00"

    insert_job: Job1  job_type: CMD          machine: PRD      box_name: BOX1      command:  "sleep 900"      owner:  autsys   

    description:  "Sleep job for 15 minutes"    days_of_week: tu,we,th,fr,sa    start_times: "1:00"


    insert_job: job2 job_type: CMD      machine: PRD      box_name: BOX1      command:  "sleep 900"      owner:  autsys
    description:  "Sleep job for 15 minutes"   
    days_of_week: mo,tu,we,th,fr    start_times: "17:00"


    Behavior:


    Iteration 1: Box Job start running on 14:00 on MO, Job2 starts at 17:00 on Mo, Job Job 1 starts at 1 AM on Tu

    Iteration 2: Box Job start running on 14:00 on Tu, Job2 starts at 17:00 on Tu, Job Job 1 starts at 14:00 PM on Tu (instead of Wednesday 1 AM)

    ...

    Iteration 5: BOX Job starts running on 14:00 on fr, Job2 starts at 17:00 on fr, Job Job 1 starts at 14:00 PM on fr (instead of Saturday 1 AM)


    I have introduced Run-window on Job 1 as "01:00-13:55", it's scheduled as expected. And running as per my expectation, But BOX status goes to Success as soon as runwindow is crossed & again loaded fresh. Need to understand the behavior of the BOX & runwindow. Attached a snapshot of running cycles.


    insert_job: BOX1          job_type: box          days_of_week: mo,tu,we,th,fr          start_times: "14:00"

    insert_job: Job1  job_type: CMD          machine: PRD      box_name: BOX1      command:  "sleep 900"      owner:  autsys   

    description:  "Sleep job for 15 minutes"   run_window: "01:00-13:55"         days_of_week: tu,we,th,fr,sa    start_times: "1:00"


    insert_job: job2 job_type: CMD      machine: PRD      box_name: BOX1      command:  "sleep 900"      owner:  autsys
    description:  "Sleep job for 15 minutes"   
    days_of_week: mo,tu,we,th,fr    start_times: "17:00"


    Thanks



  • 2.  Re: Run window behavior inside Box Job

    Posted 09-07-2015 08:28 AM

    Hi!

    Have I understood you right when asuming that job2 should run mon-fri at 1700 and job 1 should run at tue-sat at 0100?

    Is job1 dependent on job2? If there is a dependency between the two jobs then they should reside in the same box, otherwise not I would say.

    In that case you can set the starting time of the box to 1700 and make job1 an autohold-job that is automatically set off-hold at 0100 through a bat-script/shellscript running outside the box.

    Thats how I would have solved at my site.



  • 3.  Re: Run window behavior inside Box Job

    Posted 09-07-2015 08:34 AM

    NOTE:

    BE VARY CAREFUL with timed jobs inside a box. Make sure they follow the same calendar or run. if the jobs inside a box prevent the box from completing you will miss yournext run and the jobs inside the box will go out of sync.

    with that said.

    a job with a run_window will go inactive when the window is missed and reset for the next scheduled run.

    box

    j1

    j2

     

    if the box is R

    and j2 is dependent on J1 and J1 is IN due to missed run window. J2 will not run and the box will not complete. Thus J2 should also have a run window.

     

    if j1 and J2 are independently timed and have no connection, then i question why they are in a box.