Scheduler Cron Syntax

This topic provides instructions for using Quartz cron syntax with Scheduler.

Overview

Scheduler uses Quartz cron, a custom form of cron syntax, for scheduling tasks. This format is based on traditional cron syntax.

See the sections below for more information about Quartz cron syntax, requirements, and limitations.

Scheduler Cron Syntax

The following table describes special characters in Quartz cron syntax. You can use these special characters to create scaling rules with Scheduler.

* Every
? Any
## Value
#-# Range

For more information about special characters, see Cron Trigger Tutorial.

Examples of Cron Syntax

The following are examples of custom scaling rules with Scheduler:

  • Every Hour:

    cf schedule-call my-call "0 * * * ?"
    
  • Every day at 8:30am:

    cf schedule-call my-call "30 8 ? * *"
    
  • Every week at 6pm on Friday:

    cf schedule-call my-call "0 18 ? * 5"
    

For more examples, see Cron Trigger Tutorial.

Quartz Cron Requirements and Limitations

The following are requirements and limitations of Quartz cron:

  • The day of week cannot conflict with the day of the month in the cron expression. Quartz cron requires at least one of the “Day” fields to be non-wild. For example, "* * ? * *" and "* * * * ?" both run the task at the same interval.

  • Day of week starts at 0 for Sunday.