Rundeck crontab格式

时间:2014-05-11 19:19:11   收藏:0   阅读:657

rundeck的crontab任务不同于Linux上边的,它精确到秒级别。另外它还存在几个关键的注意事项。

官网链接:http://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger



定时任务教程

介绍

cron is a UNIX tool that has been around for a long time, so its scheduling capabilities are powerful and proven. TheCronTrigger class is based on the scheduling capabilities of cron.

CronTrigger uses "cron expressions", which are able to create firing schedules such as: "At 8:00am every Monday through Friday" or "At 1:30am every last Friday of the month".

Cron expressions are powerful, but can be pretty confusing. This tutorial aims to take some of the mystery out of creating a cron expression, giving users a resource which they can visit before having to ask in a forum or mailing list.

格式

一个cron表达式包含6或7个字段,用空格隔开(跟Linux的大致相同),字段(特殊字符)等格式如下

字段名强制性允许值允许的特殊字符
SecondsYES0-59, - * /
MinutesYES0-59, - * /
HoursYES0-23, - * /
Day of monthYES1-31, - * ? / L W
MonthYES1-12 or JAN-DEC, - * /
Day of weekYES1-7 or SUN-SAT, - * ? / L #
YearNOempty, 1970-2099, - * /

这样的表达式很简单,如下(其实不简单,如果你曾被他折腾过): * * * * ? *

or 复杂的表达式, 看这个: 0/5 14,18,3-39,52 * ? JAN,MAR,SEP MON-FRI 2002-2010


特殊字符

‘L‘和‘W‘字符,也可以在一个月中相结合,以产生‘LW‘,它转换为*“每月最后一个工作日”*。


例子

Here are some full examples:

bubuko.com,布布扣

注意点


本文出自 “豆包的博客” 博客,请务必保留此出处http://407711169.blog.51cto.com/6616996/1409388

Rundeck crontab格式,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!