Quartz:Cron Expressions
原文地址:http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontrigger.html
注意:
位也可能是7位,最后1位的年可以省略。
位和第6位使用问号解决每月的那几天和每周的那几天的冲突问题。加了问号表示该位不起作用。
Format
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 as follows:
|
Field Name |
Mandatory |
Allowed Values |
Allowed Special Characters |
|
Seconds |
YES |
0-59 |
, - * / |
|
Minutes |
YES |
0-59 |
, - * / |
|
Hours |
YES |
0-23 |
, - * / |
|
Day of month |
YES |
1-31 |
, - * ? / L W |
|
Month |
YES |
1-12 or JAN-DEC |
, - * / |
|
Day of week |
YES |
1-7 or SUN-SAT |
, - * ? / L # |
|
Year |
NO |
empty, 1970-2099 |
, - * / |
Examples
Here are some full examples:
|
Expression |
Meaning |
|
0 0 12 * * ? |
Fire at 12pm (noon) every day |
|
0 15 10 ? * * |
Fire at 10:15am every day |
|
0 15 10 * * ? |
Fire at 10:15am every day |
|
0 15 10 * * ? * |
Fire at 10:15am every day |
|
0 15 10 * * ? |
2005 Fire at 10:15am every day during the year 2005 |
|
0 * 14 * * ? |
Fire every minute starting at 2pm and ending at 2:59pm, every day |
|
0 0/5 14 * * ? |
Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day |
|
0 0/5 14,18 * * ? |
Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day |
|
0 0-5 14 * * ? |
Fire every minute starting at 2pm and ending at 2:05pm, every day |
|
0 10,44 14 ? 3 WED |
Fire at 2:10pm and at 2:44pm every Wednesday in the month of March. |
|
0 15 10 ? * MON-FRI |
Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday |
|
0 15 10 15 * ? |
Fire at 10:15am on the 15th day of every month |
|
0 15 10 L * ? |
Fire at 10:15am on the last day of every month |
|
0 15 10 L-2 * ? |
Fire at 10:15am on the 2nd-to-last last day of every month |
|
0 15 10 ? * 6L |
Fire at 10:15am on the last Friday of every month |
|
0 15 10 ? * 6L |
Fire at 10:15am on the last Friday of every month |
|
0 15 10 ? * 6L 2002-2005 |
Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005 |
|
0 15 10 ? * 6#3 |
Fire at 10:15am on the third Friday of every month |
|
0 0 12 1/5 * ? |
Fire at 12pm (noon) every 5 days every month, starting on the first day of the month. |
|
0 11 11 11 11 ? |
Fire every November 11th at 11:11am. |
Quartz:Cron Expressions的更多相关文章
- 【Cron Expressions】Quartz Scheduler 2.1.x 英文节选
Cron Expressions Cron-Expressions are used to configure instances ofCronTrigger. Cron-Expressions ar ...
- Cron Expressions——Cron 表达式(QuartZ调度时间配置)
如果你需要像日历那样按日程来触发任务,而不是像SimpleTrigger 那样每隔特定的间隔时间触发,CronTriggers通常比SimpleTrigger更有用. 使用CronTrigger,你可 ...
- Quartz(一):Cron表达式
正文 1. 表达式介绍 Cron:cron表达式用于配置cronTrigger的实例.cron表达式实际上是由七个子表达式组成.这些表达式之间用空格分隔. Cron格式:[秒] [分] [小时] [日 ...
- Quartz中Cron表达式使用方法
Quartz中CronTrigger支持日历相关的反复时间间隔(比方每月第一个周一运行),而不是简单的周期时间间隔. 它的调度规则基于 Cron 表达式. 以下就来说一下Cron表达式的规则及使用方法 ...
- Date与Quartz的cron之间的相互转换
1.概述 最近在写一个Quartz相关的模块,需要实现Date与Quartz的cron之间的相互转换,在网上查了一下竟然没有找到,但是找到一份这样的博客:http://hw1287789687.ite ...
- Quartz 用 cron 表达式存放执行计划
Quartz 用 cron 表达式存放执行计划.引用了 cron 表达式的 CronTrigger 在计划的时间里会与 job 关联上. 1.Quartz cron 表达式支持七个域如下: 名称 是否 ...
- android switch语句报错:case expressions must be constant expressions
今天无意中碰见了 case expressions must be constant expressions 的问题 写了一个 switch(item.getItemId()) { case R. ...
- linux分享四:cron系统
cron相关文件: /etc/cron.monthly/ /etc/cron.weekly/ /etc/cron.daily/ /etc/cron.hourly/ /etc/cron.d/ /etc/ ...
- AS报错:lambda expressions are not supported at this language level
AS报错:lambda expressions are not supported at this language level 解决方法 打开打开 File --> Project Stuct ...
随机推荐
- Http Request
function getSend($url,$param) { $ch = curl_init($url."?".$param); curl_setopt($ch,CURLOPT_ ...
- struts2和hibernate整合的小Demo
jar包下载地址 创建一个web项目. 导入jar包 配置web.xml <?xml version="1.0" encoding="UTF-8"?> ...
- 一个简单的任务执行时间监视器 StopWatch
有时我们在做开发的时候需要记录每个任务执行时间,或者记录一段代码执行时间,最简单的方法就是打印当前时间与执行完时间的差值,然后这样如果执行大量测试的话就很麻烦,并且不直观, 如果想对执行的时间做进一步 ...
- Core Data 多线程时多个context使用
原文地址:http://blog.csdn.net/willmomo/article/details/19759413 写的非常好!我这里截取一点重要的,备份,请去原地址阅读! 本人去年10月份才接触 ...
- 算法手记 之 数据结构(堆)(POJ 2051)
一篇读书笔记 书籍简评:<ACM/ICPC 算法训练教程>这本书是余立功主编的,代码来自南京理工大学ACM集训队代码库,所以小编看过之后发现确实很实用,适合集训的时候刷题啊~~,当时是听了 ...
- monitor system
#!/bin/bash # #Snapshot_Stats - produces a report for system stats # This report will mail to root. ...
- Match:Period(POJ 1961)
Period 题目大意:给定一个字符串,要你找到前缀重复了多少次 思路,就是kmp的next数组的简单应用,不要修正next的距离就好了,直接就可以跳转了 PS:喝了点酒用递归实现除法和取余了...结 ...
- C Primer Plus_第三章_数据和C_复习题与编程练习
Review long代替int类型变量的原因是什么? 在您的系统中,long可以容纳比int更大的数:如果您确实需要处理更大的值,那么使用一种在所有系统上都保证至少是32位的类型会使程序的可移植性更 ...
- 【leetcode】Implement strStr() (easy)
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...
- php数据访问(批量删除)
批量删除: 首先给每一行加上复选框,也就是在自增长列内加入checkbox.因为这里可以多选,也可以单选,所以在传值的时候需要传一个数组来进行处理,所以复选框name的值设定一个数组.传值都是传的va ...