Automic Workload Automation

Expand all | Collapse all

Recurring Run schedule to 5 minutes BEFORE every hour

  • 1.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 14, 2017 05:14 AM
    I would like to start a job recurring every 5 minutes BEFORE every hour. 
    Example: 9:55, 10:55, 11:55...
    Before I ran the job every hour at 9:00, 10:00, 11:00... which worked fine.
    8kj339m4rsla.pnghttps://us.v-cdn.net/5019921/uploads/editor/ob/8kj339m4rsla.png" width="436">
    Thanks in advance


  • 2.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 14, 2017 11:27 AM
    You can create a script or event that would run your job every 55 minutes.  Take a look at this Community post and see if it's something you can work with.  Good luck!


  • 3.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 14, 2017 11:33 AM
    You can start the Job at XX:55 with the setting "every 01:00 hour"

    If it shall be started (almost) exactly at XX:55 I would suggest creating a JSCH object and define the object start at e.g.
    06:55
    07:55
    08:55
    ...
    ...
    ...




  • 4.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 20, 2017 02:32 AM
    I've done something similar before using an Event object that triggers ever hour starting at 5 mins to the hour, then adding the following line in the !Process Tab to make sure that it would never trigger too early.  You could add some more logic to control it more but this worked for us.

    :SET &NOW# = SYS_TIME(MM) :IF &NOW# < 55 :  SET &WAITTIME# = SUB(55,&NOW#) :  SET &WAITSECONDS# = MULT(&WAITTIME#,60) :  WAIT &WAITSECONDS# :ELSE :  SET &ACTOBJ = ACTIVATE_UC_OBJECT(JOBNAME) :ENDIF



  • 5.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 20, 2017 06:07 AM
    Mike_Halliday_7686
    Wonderful solution.Thanks so much! Can't wait to try it now.
    One little question remains.
    Which option do you set in the Event tab? "Check in intervals of" or "Check time"?
    zhz0wnlw5bia.pnghttps://us.v-cdn.net/5019921/uploads/editor/9w/zhz0wnlw5bia.png" width="716">

    FrankMuffke
    This was my solution that I thought of first, but can't be the best. 

    My solution that stuck in my head so far was an SQL Event triggered every minute to check following (syntax is just abstract and probably not working):
    SELECT DATETIME(MINUTE) FROM DUAL
    Then check with the event if the result is 55.


  • 6.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 21, 2017 06:17 PM
    I had it set to intervals of 60 mins and it worked well. Our event is no longer needed so I'm doing this from memory :smile:


  • 7.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 27, 2017 09:18 AM
    Impossible for the whole day today to get this running.
    The job to be triggered is named: JOBS.CAMPAIGN_STARTFLOWCHART.SESSION_SPERRE
    My syntax in the process tab is:
    :SET &NOW#=SYS_TIME(MM) :IF &NOW# < 55 :  SET &WAITTIME#=SUB(55,&NOW#) :  SET &WAITSECONDS#=MULT(&WAITTIME#,60) :  WAIT &WAITSECONDS# :  ELSE :    SET &ACTOBJ=ACTIVATE_UC_OBJECT(JOBS.CAMPAIGN_STARTFLOWCHART.SESSION_SPERRE) :ENDIF
    I start the event at any time and the first time reaching 5 minutes to the hour it is triggered and from there on the statistics of the event show:
    7ka7gkx2ca85.pnghttps://us.v-cdn.net/5019921/uploads/editor/1i/7ka7gkx2ca85.png" width="901">
    It seems the trigger is fired every 5 minutes to the hour. 
    But the job in the script isn't called. The events doesn't have a report, nor do the child have one. Senseless to put some P's in there to generate output.


  • 8.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 27, 2017 10:13 AM
    I tested your example in my 11.2.4 Environment - was working fine.

    If you do a :PRINT in your !EVNT Tab you´ll see it in the !EVENT Report as a child task of your EVNT.

    jhwasd9brspo.jpghttps://us.v-cdn.net/5019921/uploads/editor/30/jhwasd9brspo.jpg" width="903">

    Background: That was implemented a long time ago cause if there was the logging within the EVNT Report - it would become longer and longer - neverending. So UC4 changed that in a quite early version.

    Similar - but indeed different the behavior of a JSCH object - this one gets a new Run ID at every period turnaround.

    Which Automic AE Version do you use? possibly its abug?

    Just a hint - do always define Script vara names with a trailing # - there can be no mismatch between similar variables like &TIMSTAMP# and &TIMESTAMP1# etc.


  • 9.  Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Mar 28, 2017 09:03 AM
    Hey!

    Although I prefer Events (with intervals check), there is the possibility to force the object to be executed on a determined recurring clock time by using the "Execute"->"Execute Recurring" method.

    And, in v12, there is also the Period Object that can be used to facilitate this setup.

    This way, you can avoid some of the runs starting on xx:56 or xx:57 as this can happen with the Event.
    But, if this is not a problem, then the Repeated Event is fine.

    Also, in some cases where the user is expecting their results to be updated at every full hour, I setup the Event with a smaller interval, let's say 20 minutes, so that it's not so important the exact minute when the script is running.


  • 10.  Re: Recurring Run schedule to 5 minutes BEFORE every hour

    Posted Feb 01, 2019 10:13 AM

    Replying to an old post, but similar to previous ideas, I've set up the !Process tab to read as follows to run a job at XX:45. It's a 1 minute event, but removes the arithmetic in the scripting. 

     

    :SET &NOW# = SYS_TIME(MM)
    :IF &NOW# = 45
    : set &runnr=activate_uc_object(jobp,TK_TEST_XX45_JOB)
    : else
    : endif