AutoSys Workload Automation

  • 1.  Scheduling help

    Posted Jul 18, 2018 01:02 PM

    Hello All,

     

    The requirement we have here is,

     

    job_b runs every 2 hours and takes around 1.5hrs to complete and now the job_b needs to have a predecessor (job_a) which runs Sunday 22:00. 

     

    the requirement here is if job_a continues to run Monday morning beyond 04:30 am and doesn't complete before 05:00 am, the job_b job should skip its 04:30 run and run from its next scheduled run, so on if the predecessor job is still running beyond 06:30am run and doesn't complete before 07:00am it should skip 06:30am run and pick its next schedule.

     

    Looking for advice to schedule the job_b as per the requirement

     

    insert_job: Job_A job_type: CMD
    command: abcd.sh
    machine: test
    owner: test
    permission:
    date_conditions: 1
    days_of_week: su
    start_times: "22:00"

    alarm_if_fail: 1

     

    insert_job: Job_B job_type: CMD
    command: abcd.sh
    machine: test
    owner: test
    permission:
    date_conditions: 1
    days_of_week: mo,tu,we,th,fr
    start_times: "04:30,06:30,8:30,10:30,12:30,14:30"

    condition: s(Job_A)

    alarm_if_fail: 1



  • 2.  Re: Scheduling help

    Posted Jul 18, 2018 01:27 PM

    How about other days of week for job a.

     

    i mean i can see job a runs only on sunday , but job b runs whole week, so for tuesday run, job b will look for job A's sunday /monday successful execution?



  • 3.  Re: Scheduling help

    Posted Jul 18, 2018 01:33 PM

    Hello Sunil,

     

    the job_a will run only once a week sun at 2200, 

    yes, from Tuesday till Friday the job_b will look for sunday's successful run. 



  • 4.  Re: Scheduling help

    Posted Jul 18, 2018 07:54 PM

    Basically, you do not want job_b to persist with its STARTJOB event after half-hour of its original start time. Correct?

    AutoSys doesn't like to give up

    It might be simple to split the job_b into multiple jobs with narrow run_window so that it doesn't start outside of the half-hour gap (04:30 ~ 05:00).



  • 5.  Re: Scheduling help

    Posted Jul 19, 2018 12:06 AM

    Hello Chandru, yes that's correct job_b should not start if it crosses half-hour from its original start time.

     

    That was my initial thought to split job into multiple start times and run_window assigned to it, but the problem here is job_b has a downstream, hence splitting the job into multiple start times and updating all the downstream is not an ideal scenario and the end user also didn't like it.



  • 6.  Re: Scheduling help

    Posted Jul 19, 2018 12:57 AM

    if any job is having uncertain or long runs then Ideally it means that the script or program running behind the scenes needs to be optimized otherwise you will run in to these situations.

     

    I agree with Chandru, splitting the jobs in to multiple runs will be the best fit or you can try to replicate or duplicate the whole stream based on the executions/run cycle.

     

    For executions other than monday for job_b, you may need to use lookback feature, but do the extensive testing as lookback feature needs special attentions during adhoc runs & outages.



  • 7.  Re: Scheduling help

    Posted Jul 21, 2018 10:24 PM

    Hi Tukaram,

     

    You need two jobs at the least.

    One for  Mondays with

     

    condition: s(job_A,00.30)

    start_times: "05:00,07:00,9:00,11:00,13:00,15:00"

     

    This way, on Mondays, job_B won't start unless job_A completed half hour (04:30 ~ 05:00, 06:30 ~ 07:30, etc) prior to its scheduled run.

     

    As for rest of the days, the definition as is should be good assuming job_A won't run longer than Monday.

     

    Cheers,

    Chandru



  • 8.  Re: Scheduling help

    Posted Jul 30, 2018 03:19 PM

    Hello Chandru,

     

    Thank you for the response, the user doesn't want to split job to have one run on monday and other to run rest of the week and update the conditions on all the downstream.

     

    I have suggested using global variable in JOB_B to look for the variable true/false.

     

    firstly every Friday at the end of its week's schedule, a global variable job will run setting the variable to false.

     

    on monday there will be global_var_job jobs scheduled to run at 04:30 with run_window (04:29 - 05:00)  and success of job_a, likewise 2 more job will be scheduled to run at 06:30 and 08:30 with run windows (06:29 - 07:00 and 08:29 - 09:00).

     

    when the job_a overruns and doesn't complete within half an hour of its subsequent run, the global variable will continue to remain false.and from previous history of job_a it has max completed by 8, so the 08:30 global variable jobs will set the value to true allowing job_b to run for the rest of the week.