AutoSys Workload Automation

 View Only
  • 1.  Having trouble understanding job dependancy

    Posted Sep 24, 2015 07:59 AM

    Greetings all.

     

    Hope this is the correct place to post this, but I'm having an issue which I cannot see to find a good way to do.

     

    I have the following scenario:

     

    Job 1 -> Scheduled to run daily

    Job 2 -> Scheduled to run last day of month

    Job 3 -> Scheduled to run daily

     

    Job 2 is dependant on Job 1

    Job 3 is dependant on Job 1 and Job 2 if Job 2 needs to run.

     

    I'm unable to find a good way to do this, since Job 2 only can get success when it's last day of month, which then means Job 3 will only run if it is last day of month.

     

    I've had 1 idea on how to do this, but it seems overkill to me, the following structure is what I'm thinking:

     

    Job 1 -> Scheduled to run daily

    Job 3 -> Scheduled to run daily

     

    Box 1 contains: (Box 1 will success if following condintion (s(Job3) or s(Job2)) and dependant on Job 1)

    Job 2 -> Scheduled to run last day of month

    Job 3 -> Scheduled to run when it's not last day of month -> Always sets itself to success (can't fail)

     

    Job 3 is dependant on Box1 and Job1

     

    So is there any better way to solve this? Hopefully without jil commands.



  • 2.  Re: Having trouble understanding job dependancy

    Posted Sep 24, 2015 08:26 AM

    Hi!

    I would have job2 in autohold every day and set it to success from an outside routine all days but the run once a month when I instead would release it. The box itself selected all days.

    Hope that helps, good luck!



  • 3.  Re: Having trouble understanding job dependancy

    Posted Sep 24, 2015 11:00 AM

    Forgot to say that with this way of scheduling you need job3 to wait for both job1 and job2 otherwise things will go wrong. The routine outside the box (two separate jobs with different extended calendars) handling success and offhold uses sendevent.



  • 4.  Re: Having trouble understanding job dependancy
    Best Answer

    Posted Sep 24, 2015 09:20 AM

    You need two Job2, both dependent on Job1.

    Job2a runs every day _except_ the last day of the month, running something like /bin/true on Unix or set on Windows. The popular parlance for this is a "dummy" job.

    Job2b runs the required command on the last day of the month.

    Job3 depends on 2a OR 2b.



  • 5.  Re: Having trouble understanding job dependancy

    Posted Sep 25, 2015 01:21 AM

    Thanks for the replies, seems like having to do it like @JoeP suggest and like the only way to avoid having to maintain and know job order.



  • 6.  Re: Having trouble understanding job dependancy

    Posted Sep 25, 2015 08:36 AM

    Hi!

    I have to add that my solution does not contain maintenance or the need to know the order, it is just a matter of automate and forget :).

    But the other solution JoeP provided looks nice as well and maybe a bit easier. Be careful using calendars and timesettings inside a box, that could cause problems later on.

    Good luck in your automation.