Quartz v1.x 排程設定檔

排程設定檔中 cronExpression 為指定任務執行規則,其格式如下:
  • 秒 (0-59) 必要
  • 分 (0-59) 必要
  • 時 (0-23) 必要
  • 每月第幾天 (1-31) 必要
  • 月 (1-12 || JAN-DEC) 必要,不分大小寫
  • 每星期第幾天 (1-7 || SUN-SAT) 必要,不分大小寫
  • 年 (可省略)
6 或 7 欄,以空白分隔

 其中【每月第幾天】與【每星期第幾天】只能擇一設定,不可同時設值,也就是其中之一必須要用 ? 表示

* 所有值
? 不設定
例:
0 0 6 * * ?     Run Every Day at 6 AM (年省略沒設)
0 0 6,8,10 * * ?     Run Every Day at 6, 8, 10 AM (年省略沒設)
0 0 6 10-15 * ?     Run Every Month from 10th to 15th at 6 AM (年省略沒設)
0 0 6 ? * MON     Run Every Monday at 6 AM (年省略沒設)
0 0 1/5 * * ?     Run Every 5 hours starting from 1 AM
0 0 5 L * ?     Run at 5 AM on the last day of every month
0 0 5 ? * L     Run at 5 AM every Saturday
0 0 5 ? * 6L     Run at 5 AM on the last Friday of every month
0 0 5 ? * 6#3     Run at 5 AM on the third Friday of every month

Refer to : CronTrigger

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s