kbmMW Scheduler Tidbits #6 – Extended CRON

In the blog “kbmMW Scheduler Tidbits #2 – CRON’ I explained how to use the nice Unix like Cron feature in kbmMW’s scheduler.

The original syntax already supported Cron extended features like year, but in kbmMW we don’t stop there. We have extended it further to also support seconds for easy of use.

The following explains how the various Cron parts are to be specified.

If only 5 parts are given, kbmMW will assume that a standard Cron format is used. Hence the 5 parts are:

minute hour day month dayofweek

If 6 parts are given, kbmMW will default assume that it’s the year extended Cron format that is used. Hence the 6 parts are:

minute hour day month dayofweek (year)

(‘year’ part is optional)

kbmMW however now supports specifying a Cron TkbmMWScheduleCronMode argument as part of the Cron method to make it interpret the parts differently. For example to ask kbmMW to interpret a 5 or 6 part Cron as:

(second) minute hour day month dayofweek

(‘second’ part is optional), you would provide the mode value mwscmExtendedSecond.

And to be able to provide a 7 part Cron argument, where both extended seconds and extended year is provided like this:

second minute hour day month dayofweek year

(no parts are optional), you would provide the mode value mwscmExtendedSecondAndYear.

Examples:

kbmMW Scheduler Tidbits #1 – Async methods

kbmMW Scheduler Tidbits #2 – CRON

kbmMW Scheduler Tidbits #3

kbmMW Scheduler Tidbits #4

Author: kimbomadsen

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.