AutoSys Workload Automation

Expand all | Collapse all

Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

  • 1.  Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

    Posted 04-10-2019 04:34 PM

    I have given the below conditions to run every 4 hours during those days, but the problem is the job is running at 01:00, 05:00 and 08:58 on Wednesdays. I expect the job to run at those hours on Thursday and not Wednesday

     

    insert_job: file_watcher.0000.000 job_type: BOX

    date_conditions: 1

    days_of_week: we,th

    start_times: "09:00,13:00,17:00,21:00,01:00,05:00,08:59"

    run_window: "09:00 - 08:59"

     

    Please help me to achieve this.



  • 2.  Re: Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

    Posted 04-10-2019 04:49 PM

    You will need to create 2 jobs, one that runs on Wednesday at the desired times and one on Thursday at the desired times. No need for the run window.



  • 3.  Re: Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

    Posted 04-10-2019 04:53 PM

    Can't we do that in a single job as I have 15 jobs similar to this scenario.



  • 4.  Re: Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

    Posted 04-11-2019 09:19 AM

    I am confused as you have Wednesday in days of week.  I would think days of week  tuesday and Thursday  and start time  4:00, 8:00 12:00 16:00 20:00 and 23:59  ( if you want the midnite run ) .  As Lisa said -  no run window required. 



  • 5.  Re: Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

    Posted 04-11-2019 09:25 AM

    It is not possible to do this with a single job, but there is an alternate way of doing this that does not require two copies of this box being created.

     

    Create two jobs that set a global environment variable (such as RUN_FILEWATCHER).  Have one run at 09:00 on Wednesday to set it to "1" and one that runs at 09:05 on Thursday to set it to "0".

     

    Change the job to have a condition and start times (remove the run window).

    condition: v(RUN_FILEWATCHER)="1"

    start_times: "01:00,05:00,09:00,13:00,17:00,21:00"

     

    Then leverage this global variable for the other 14 jobs with the same condition.

     

    As a reverse, you can use the variable to say when NOT to run the job.  We do this for jobs that run 7x24 to prevent them from running during our maintenance window.

     

    The logic is this: The job will schedule itself to run during the next time but then must wait until the GV condition is true.  The moment it is set to true, the job runs (which is why you set it to true on Wednesday when you want it to actually run).  On Thursday at 13:00, it will try to start but then wait for the GV to be set to true again the following Wednesday.



  • 6.  Re: Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

    Posted 04-11-2019 09:30 AM

    Keith,

     

    +1 for creative solution!

     

    Lisa



  • 7.  Re: Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

    Posted 04-11-2019 01:05 PM

    Thanks for your suggestion Keith.



  • 8.  Re: Scheduling a job to run every 4 hours starting from 9 AM Wednesday till 8:59 AM Thursday in Autosys

    Posted 04-12-2019 11:12 AM

    Instead of start times, you can try using a run calendar by adding dates in below format. 

     

    04/17/2019 09:00

    04/17/2019 13:00

    04/17/2019 17:00

    04/17/2019 21:00

    04/18/2019 01:00

    04/18/2019 05:00

    04/18/2019 08:59