Cron Trigger
Overview
The Cron trigger, similar to the Time trigger, allows you to specify dates and times at which a task will be triggered.
With both Cron and Time triggers, you can define:
Simple date and times, such as "every weekday at 12:00 a.m."
Specific dates and times, such as "March 15 at 12:00 a.m."
A series of dates and times, such as "every Friday at every hour."
A mixture of specific dates/times and a series, such as "every Monday at 9 a.m."
Complex dates and times, such as "every 3 hours between 8 a.m. and 5 p.m. on the last business day of the year."
(Read Daylight Saving Time for details about how Universal Controller handles Daylight Saving Time.)
It is recommended that you use a Cron trigger, rather than a Time trigger, if you want to schedule non-standard time intervals for a triggering a task (see Cron Trigger#Scheduling a Time Interval, below).
Cron Syntax
The Cron trigger uses standard Cron syntax. Once the Cron trigger is entered into the system, the Controller interprets it and processes it as it would any other trigger. The trigger is satisfied when the current date and time match all the values specified in the Minutes, Hours, Day of Month, Month, and Day of Week fields.
Cron Fields
The following table identifies the allowed values for the time and date fields that are used to specify the Cron Criteria in the Cron Trigger Details.
Field Name | Required | Allowed Values | Allowed Special Characters |
|---|---|---|---|
Minutes | Yes | 0-59 | * / , - |
Hours | Yes | 0-23 | * / , - |
Day of Month | Yes | 1-31 | * / , - |
Month | Yes | 1-12 or JAN-DEC | * / , - |
Day of Week | Yes | 0-7 or SUN (0 or 7)-SAT | * / , - |
Note
The day when a Cron trigger launches can be specified by two fields: Cron Trigger#Day of Month and Cron Trigger#Day of Week. If both fields are restricted (that is, they both are not *), the trigger launches based on the Cron Trigger#Day Logic field value. If Cron Trigger#Day Logic is set to Or, when either Day field matches, the trigger can launch. For example: 30 4 1,20 * 5 would cause the trigger to launch at 4:30 a.m. on the 1st and 20th of each month, as well as on every Friday. If, however, Cron Trigger#Day Logic is set to And, the trigger would launch at 4:30 a.m. only on days that are the 1st or 20th which are also a Friday.
Cron Special Characters
Asterisk ( * ) | An asterisk indicates that the expression matches for all values of the field. For example, using * in the Month field indicates every month. |
|---|---|
Slash ( / ) | A slash describes an increment of ranges. For example, 5-50/15 in the Minutes field indicate the fifth minute of the hour and every 15 minutes thereafter until the 50th minute (5,20,35,50). |
Hyphen ( - ) | Defines a range of numbers, which are two numbers separated by a hyphen. The specified range is inclusive. For example, 9-17 in the Hours field means from 9 a.m. to 5 p.m., inclusive. |
Comma ( , ) | Separates items in a list. A list is a set of numbers or ranges separated by commas. For example, 1,5-9,18-20 in the Hours field indicate the following hours 1,5,6,7,8,9,18,19,20. |
Cron Criteria Examples
Cron Criteria | Description |
|---|---|
0 3 30 4,6,9,11 5 | At 3 a.m. on the 30th of the month, for months with exactly 30 days, if the 30th is a Friday. |
0 3 31 * 0 | At 3 a.m. on the 31st of the month if the 31st is a Sunday. |
0 3 22-28 * 0 | At 3 a.m. on the 4th Sunday of every month. |
0 5-19/7 * * * | Every 7 hours between 5 a.m. and 7 p.m., daily. |
0 5,12,19 * * 1,3 | Every 7 hours between 5 a.m. to 7 p.m. on Monday and Wednesday. |
0 9-17 * * Mon-Fri | Every hour between 9 a.m. and 5 p.m. from Monday to Friday. |
0 2-11/3 * * * | Every 3 hours between 2 a.m. and 11 a.m., daily. |
0 3 29 2 * | At 3 a.m. on February 29th. |
30 1-3,17 * * 1,3,5 | At 30 minutes past the hours of 1 a.m., 2 a.m., 3 a.m., and 5 p.m. on Monday, Wednesday, and Friday. |
Creating a Cron Trigger
Step 1 | From the Automation Center navigation pane, select Triggers > Cron Triggers. The Cron Triggers list displays. |
|---|---|
Step 2 | Enter/select Details for a new Cron trigger, using the field descriptions below as a guide.
To display more of the Details fields on the screen, you can either:
|
Step 3 | Click a button. The trigger is added to the database, and all buttons and tabs in the Trigger Details are enabled. |
Step 4 | Enable the trigger(s) as desired. |
Note
To open an existing record on the list, either:
Click a record in the list to display its record Details below the list. (To clear record Details below the list, click the New button that displays above and below the Details.)
Clicking the Details icon next to a record name in the list, or right-click a record in the list and then click Open in the Action menu that displays, to display a pop-up version of the record Details.
Right-click a record in the a list, or open a record and right-click in the record Details, and then click Open In Tab in the Action menu that displays, to display the record Details under a new tab on the record list page (see Record Details as Tabs).
Cron Trigger Details
The following Cron Trigger Details is for an existing Cron trigger. See the field descriptions, below, for a description of the fields that display in the Cron Trigger Details.
Cron Trigger Details Field Descriptions
The following table describes the fields, buttons, and tabs that display in the Cron Trigger Details.
Field Name | Description |
|---|---|
General | This section contains general information about the trigger. |
Name |
|
Version | System-supplied; version number of the current record, which is incremented by the system every time a user updates a record. Click the Versions tab to view previous versions. For details, see Record Versioning. |
Description | Description of this record. Maximum length is 255 characters. |
Member of Business Services | User-defined; Allows you to select one or more Business Services that this record belongs to. (You also can Check All or Uncheck All Business Services for this record.) You can select up to 62 Business Services for any record type, and enter a maximum of 2048 characters for each Business Service. If the Business Service Visibility Restricted Universal Controller system property is set to true, depending on your assigned (or inherited) Permissions or Roles, Business Services available for selection may be restricted. |
Calendar |
Select a Calendar from the drop-down list of all existing Calendars. To display detailed information about a selected calendar, click the Details icon next to the Calendar field. |
Time Zone |
User-defined; allows you to specify the time zone that will be applied to the time(s) specified in the trigger. For example, if you specify 23:00 and a time zone of Canada/Central, the task will run at 11:00 p.m. Central Canada time. |
Task(s) |
Name of the task(s) being triggered when this trigger is satisfied. When selecting tasks from the Details, click on the lock icon to unlock the field and select tasks. |
Simulate | Specifies if the instances generated by this trigger should execute under simulation mode, in which none of the tasks execute. Alternatively, simulation mode can be enabled from the Trigger Now… command (see Triggering with Variables and Triggering by Date and Time). |
Purge By Retention Duration | |
Exclude Backup | |
Retention Duration | |
Retention Duration Unit | |
Execution User | |
Forecast | |
Simulate Forecast | |
Status | This section contains information about the current status of the trigger. |
Status | |
Next Scheduled Time | |
Enabled By | |
Disabled By | |
Enabled Time | |
Disabled Time | |
Skip Details | This section contains detailed information about skipping the trigger. |
Task Launch Skip Condition | |
Skip Restriction | |
Skip Count | |
Skip Before Date | |
Skip Before Time | |
Skip After Date | |
Skip After Time | |
Skip Date List | |
Cron Details | This section contains assorted detailed information about the trigger. |
Minutes | |
Hours | |
Day of Month | |
Month | |
Day of Week | |
Cron Criteria | |
Day Logic | |
Restrictions | This section specifies any restrictions that apply to the trigger. |
Special Restriction | |
Action | |
Simple Restriction | |
Situation | |
Complex Restriction | |
Restriction Mode | |
Restriction Adjective | |
Restriction Noun(s) | |
Restriction Qualifier(s) | |
Restriction Nth Amount | |
Self-Service Options | This section contains Self-Service specifications for the trigger. |
Enforce Variables | |
Lock Variables | |
Metadata | This section contains Metadata information about this record. |
UUID | Universally Unique Identifier of this record. |
Updated By | Name of the user that last updated this record. |
Updated | Date and time that this record was last updated. |
Created By | Name of the user that created this record. |
Created | Date and time that this record was created. |
Buttons | This section identifies the buttons displayed above and below the Trigger Details that let you perform various actions. |
Save | Saves a new task record in the Controller database. |
Save & New | Saves a new record in the Controller database and redisplays empty Details so that you can create another new record. |
Save & View | Saves a new record in the Controller database and continues to display that record. |
New | Displays empty (except for default values) Details for creating a new record. |
Update | |
Enable | |
Disable | |
Trigger Now... | |
List Qualifying Times | |
Copy | Creates a copy of this trigger, which you are prompted to rename. |
Delete | |
Refresh | Refreshes any dynamic data displayed in the Details. |
Close | For pop-up view only; closes the pop-up view of this trigger. |
Tabs | This section identifies the tabs across the top of the Trigger Details that provide access to additional information about the trigger. |
Variables | |
Instances | |
Notes | |
Versions |
Scheduling a Time Interval
A Cron trigger lets you schedule a time interval for how often a task will be triggered. You also can select a time frame that restricts the time during which the trigger is active, so that a task will be triggered only at the time intervals within that time frame.
The time interval for a Cron trigger resets at the end of the day; when the 24-hour clock expires, the time interval count begins again at 12 a.m. on the next specified day. Therefore, if you select a time interval for multiple days, the task will be triggered at the same times each day.
Although you also can use a Time trigger to schedule a time interval for a task to be triggered on multiple days, you should use a Cron trigger if the time interval is not one by which the 24-hour clock is even divisible (2, 3, 4, 6, 8, and 12), such as in the Cron criteria examples, above. Using a Time trigger to schedule this type of time interval could produce unexpected results, since the time interval for a Time trigger does not reset at the end of the day. It continues into the next day, regardless of the 24-hour clock (see Scheduling a Time Interval with a Time Trigger).
Conversely, if you want to trigger a task on multiple days at a time interval without regard to the time of day, and the interval is not one by which the 24-hour clock is even divisible, you must use a Time trigger, which will not reset at the end of the day. For example, if you want to trigger a task every 5 hours, from Monday to Friday, without regard to the time of day, a Time trigger will allow you to trigger the task on Monday at 12 a.m., 5 a.m., 10 a.m., 3 p.m., 8 p.m. and then next (5 hours later) on Tuesday at 1 a.m.. This time interval scheduling cannot be accomplished with a Cron trigger.
Generating a List of Qualifying Times
The Controller allows you to generate a list of future dates and times that a trigger will trigger the specified task.
Step 1 | Click the Cron Trigger#List Qualifying Times button in the Cron Trigger Details. The List Qualifying Times Input dialog displays. |
|---|---|
Step 2 | Select a Number of Dates/Times (1 - 1000) that you want to list. The default is 30. |
Step 3 | Select a Start Date from when you want the list to begin. |
Step 4 | Click the Submit button to generate the list. For example: |