资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Quartz配置文件说明-创新互联

"Cron-Expression"由6到7个用空格分开的字段组成的表达式这6或7个字段必须遵循下面的顺序和格式:

创新互联公司专注于吉水企业网站建设,成都响应式网站建设,商城网站制作。吉水网站建设公司,为吉水等地区提供建站服务。全流程按需策划,专业设计,全程项目跟踪,创新互联公司专业和态度为您提供的服务

Seconds 0-59 , - * /

Minutes 0-59 ,- * /

Hours 0-23 , - * /

Day-of-month 1-31 , - * ? / L W C

Month 1-12 or JAN-DEC , - * /

Day-of-Week 1-7 or SUN-SAT , - * ? / L C #

Year (Optional) empty, 1970-2099 , - * /

*是一个通配符,表示任何值,用在Minutes字段中表示每分钟。

?只可以用在day-of-month或者Day-of-Week字段中,用来表示不指定特殊的值。

-用来表示一个范围,比如10-12用在Month中表示10到12月。

,用来表示附加的值,比如MON,WED,FRI在day-of-week字段中表示礼拜一和礼拜三和礼拜五。

/用来表示增量,比如0/15用在Minutes字段中表示从0分开始0和15和30和45分。

L只可以用在day-of-month或者Day-of-Week字段中,如果用在Day-of-month中,表示某个月的最后一天,1月则是表示31号,2月则表示28号(非闰年),如果用在Day-of-Week中表示礼拜六(数字7);但是如果L与数字组合在一起用在Day-of-month中,比如6L,则表示某个月的最后一个礼拜六;

C

W

#

0 1 0 1 1-12 ?表示每月1号0点1分执行。

0 0 21 ? * 1表示每个礼拜天 21点0分执行。

0 0 0 * * ?表示每天0点0分执行。

0 * 22 * * ?表示每天22点开始每分钟

0 * 0-23 * * ?表示每天每分钟(0 * * * * ? 不可以???Doltter注释)

字段

允许值

允许的特殊字符

0-59

, - * /

0-59

, - * /

小时

0-23

, - * /

日期

1-31

, - * ? / L W C

月份

1-12 或者 JAN-DEC

, - * /

星期

1-7 或者 SUN-SAT

, - * ? / L C #

年(可选)

留空, 1970-2099

, - * /

Cron 的小小说明

表示方式

意义

"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 ? * 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 * * ?" 每天中午12点触发

"0 15 10 ? * *" 每天上午10:15触发

"0 15 10 * * ?" 每天上午10:15触发

"0 15 10 * * ? *" 每天上午10:15触发

"0 15 10 * * ? 2005" 2005年的每天上午10:15触发

"0 * 14 * * ?" 在每天下午2点到下午2:59期间的每1分钟触发

"0 0/5 14 * * ?" 在每天下午2点到下午2:55期间的每5分钟触发

"0 0/5 14,18 * * ?" 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发

"0 0-5 14 * * ?" 在每天下午2点到下午2:05期间的每1分钟触发

"0 10,44 14 ? 3 WED" 每年三月的星期三的下午2:10和2:44触发

"0 15 10 ? * MON-FRI" 周一至周五的上午10:15触发

"0 15 10 15 * ?" 每月15日上午10:15触发

"0 15 10 L * ?" 每月最后一日的上午10:15触发

"0 15 10 ? * 6L" 每月的最后一个星期五上午10:15触发

"0 15 10 ? * 6L 2002-2005" 2002年至2005年的每月的最后一个星期五上午10:15触发

"0 15 10 ? * 6#3" 每月的第三个星期五上午10:15触发

创新互联www.cdcxhl.cn,专业提供香港、美国云服务器,动态BGP最优骨干路由自动选择,持续稳定高效的网络助力业务部署。公司持有工信部办法的idc、isp许可证, 机房独有T级流量清洗系统配攻击溯源,准确进行流量调度,确保服务器高可用性。佳节活动现已开启,新人活动云服务器买多久送多久。


当前文章:Quartz配置文件说明-创新互联
转载源于:http://cdkjz.cn/article/dhesps.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220