Restricting execution times

A common requirement can be to execute a script only if certain conditions are fulfilled. For example, it may be desired to have a minimum of 5 files in a directory before starting a certain step, or it may be a requirement to wait for at least 24 hours before retrying a step or to only start a process once per day in some specific time interval. The following elements can currently be used to model such restrictions:

  • weekday

  • hour

  • time delay since latest execution

  • existence of certain files

While any script execution can be restricted, it typically only makes sense to restrict the first script that starts a processing pipeline. Scripts with an execution limitation can temporarily assume the stage “Retry Later”. The belonging LIMIT parameters are also listed in chapter Spool configuration. Find some examples below:

  1. Initialize only on the weekdays Monday, Wednesday, and Friday:

    Initialize_Limit_DayOfWeek= 1,3,5
  1. Transfer only overnight (between 6 PM and 8 AM):

    Transfer_Limit_Hour = 18-24,0-8
  1. Initialize in the morning hours (between 0 and 8 AM), once per day at most, and avoid a drift issue:

    It is enough to define a minimum delay like 500 minutes (= 8 hours 20 minutes) which is slightly above the limit hour interval (8 hours below) to logically guarantee that the initialization only happens once a day. (Also compare this with the not recommended example 5 in the bottom.)

    Initialize_Limit_MinTimeToLastExec = 500
    Initialize_Limit_Hour = 0-8
    
  1. Initialize only for certain file patterns if a given minimum number is exceeded:

    The following example fires if in the directory “/input" at least 5 files are present which match a predefined filename pattern based on a regular expression. In this example the filename has to be like “test” followed by three digits and the file type extension “.txt” (e.g. “test001.txt”):

    Initialize_Limit_FilePattern = ^test[0-9]{3}.txt$
    Initialize_Limit_FileWorkDir = /input
    Initialize_Limit_FileCount = >5
    
  1. Initialize once per day by setting a minimum delay of a day with drift issue (see example 3 as alternative):

    Since this parameter only represents a minimum interval, and it is not guaranteed that the next attempt is started exactly after 24 hours (= 1440 minutes), this setting can cause a drift, which delays the actual starting time e.g. by 5 minutes per day (Scheduler retry interval). Rather than using this approach, if the goal is a “once per day restriction”, prefer an alternative like example 3 where the execution interval is under control.

    Initialize_Limit_MinTimeToLastExec = 1440