# Schedule

Schedule is used to define scheduled jobs. Schedule provides three types of schedules.&#x20;

* Flow - Execute the specified flow at the scheduled time or interval.
* Trigger Flow - Execute the specified flow if file(s) exist in the source (s)FTP server.
* Script - Execute a script file(.bat/.sh) at the scheduled time or interval.

A schedule has two states and default state when a schedule is created, it is paused.

* Paused
* Running

&#x20;

## Expression

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image057.png" alt=""><figcaption></figcaption></figure>

Schedule follows cron syntax to define a schedule.

(\*) Only either week or day can be used in one schedule definition.&#x20;

A cron expression is a string comprised of 6 or 7 fields separated by white space. Fields can contain any of the allowed values, along with various combinations of the allowed special characters for that field. The fields are explained in the following table:

&#x20;

<table><thead><tr><th width="160">Field Name</th><th width="151">Mandatory?</th><th width="193">Allowed Values</th><th>Allowed special Characters</th></tr></thead><tbody><tr><td>Seconds</td><td>Yes</td><td>0-59</td><td>, - * /</td></tr><tr><td>Minutes</td><td>Yes</td><td>0-59</td><td>, - * /</td></tr><tr><td>Hours</td><td>Yes</td><td>0-23</td><td>, - * /</td></tr><tr><td>Day of the Month</td><td>Yes</td><td>31-Jan</td><td>, - * ? / L W</td></tr><tr><td>Month</td><td>Yes</td><td>1-12 or JAN-DEC</td><td>, - * /</td></tr><tr><td>Day of the Week</td><td>Yes</td><td>1-7 OR SUN-SAT</td><td>, - * ? / L #</td></tr><tr><td>Year</td><td>No</td><td>EMPTY, 1970-2099</td><td>, - * /</td></tr></tbody></table>

&#x20;

<table><thead><tr><th width="183.33333333333331">Operator</th><th>Purpose</th><th>Example</th></tr></thead><tbody><tr><td>asterisk ( * )</td><td>Specifies all possible values for a field</td><td>An asterisk in the hour time field is equivalent to "every hour".</td></tr><tr><td>question mark (?)</td><td>A question mark ( ? ) is allowed in the day-of-month and day-of-week fields. It is used to specify "no specific value", which is useful when you need to specify something in one of these two fields, but not in the other.</td><td>If you want a trigger to fire on a particular day of the month (for example, the 10th), but you don't care what day of the week that is, enter 10 in the day-of-month field, and ? in the day-of-week field.</td></tr><tr><td>dash ( - )</td><td>Specifies a range of values</td><td>2-5, which is equivalent to 2,3,4,5</td></tr><tr><td>comma ( , )</td><td>Specifies a list of values</td><td>1,3,4,7,8</td></tr><tr><td>slash ( / )</td><td>Used to skip a given number of values</td><td><p>*/3 in the hour time field is equivalent to 0,3,6,9,12,15,18,21. The asterisk ( * ) specifies "every hour", but the /3 means only the first, fourth, seventh. </p><p>You can use a number in front of the slash to set the initial value. For example, 2/3 means 2,5,8,11, and so on.</p></td></tr><tr><td>L ("last")</td><td>The L character is allowed for the day-of-month and day-of-week fields.</td><td>The value L in the day-of-month field means "the last day of the month", which is day 31 for January, or day 28 for February in non-leap years. If you use L in the day-of-week field by itself, it simply means 7 or SAT. But if you use it in the day-of-week field after another value, it means "the last xxx day of the month". For example, 6L means "the last Friday of the month".</td></tr><tr><td>Specifies either the last day of the month, or the last xxxday of the month.</td><td>HINT:When you use the L option, be careful not to specify lists or ranges of values. Doing so causes confusing results.</td><td></td></tr><tr><td>W ("weekday")</td><td>The W character is allowed for the day-of-month field. </td><td>If you specify 15W as the value for the day-of-month field, the meaning is "the nearest weekday to the 15th of the month". So if the 15th is a Saturday, the trigger fires on Friday the 14th. If the 15th is a Sunday, the trigger fires on Monday the 16th. If the 15th is a Tuesday, it fires on Tuesday the 15th. However, if you specify 1W as the value for day-of-month, and the 1st is a Saturday, the trigger fires on Monday the 3rd, because it does not "jump" over the boundary of a month's days. The W character can only be specified when the day-of-month is a single day, not a range or list of days.</td></tr><tr><td>Specifies the weekday (Monday-Friday) nearest the given day.</td><td>HINT:You can combine the L and W characters for the day-of-month expression to yield LW, which translates to "last weekday of the month".</td><td></td></tr><tr><td>pound sign ( # )</td><td>The pound sign ( # ) character is allowed for the day-of-week field. This character is used to specify "the nth" xxxday of the month.</td><td>The value of 6#3 in the day-of-week field means the third Friday of the month (day 6 = Friday and #3 = the 3rd one in the month).</td></tr><tr><td>Other Examples: 2#1 specifies the first Monday of the month and 4#5 specifies the fifth Wednesday of the month. However, if you specify #5 and there are fewer than 5 of the given day-of-week in the month, no firing occurs that month.</td><td></td><td></td></tr></tbody></table>

&#x20;

If previous schedule is not complete when the next interval reached, the next scheduled job can be skipped with this option.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image058.png" alt=""><figcaption></figcaption></figure>

Trigger flow type requires (s)FTP server and file information. ISM scheduler connects to the (s)FTP server and checks the files exist. If the condition matches, the linked flow is executed.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image059.png" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="174">Name</th><th>Description</th></tr></thead><tbody><tr><td>Directory</td><td>(s)FTP directory. This directory is not the system directory. For example, windows directory starts with drive name like c:\. But (s)FTP directory starts with slash like /data/src.</td></tr><tr><td>File Filter</td><td>File filter. Wildcard (*) can be used.</td></tr></tbody></table>

Schedule list are loaded every 30 seconds, and scheduled if not exits, or rescheduled if the schedule is updated.
