在做活动项目时需要对时间的限制 就写模仿 crontab 写了一个
#vi /etc/crontab
crontab task 格式
* * * * * user task
分 时 日 月 周 user task
字段 说明
1 分钟(00-59)
2 小时(02-24)
3 日期(01-31)
4 月份(01-12)
5 周几(0-6,0为周日)
# utf-8
# '* * * * *' -> 分 时 日 月 周
# '* * * 1-3 *' -> 分 时 日 月 周
# '* * * 1,2,3 *' -> 分 时 日 月 周
# 01-59 01-23, 01-31, 01-12, 0-6
# simple : CrontabUtil.new("20 09 * 04 2").check_time?
# simple : ......
阅读全文