詹金斯(Jenkins)定期建造-时间表 [英] Jenkins Build Periodically - Schedule

查看:123
本文介绍了詹金斯(Jenkins)定期建造-时间表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望每15分钟进行一次定期构建.我已经上网了,我正在使用以下时间表:*/15 * * * *

I am looking to build periodically every 15 minutes. I have looked online and I am using this schedule: */15 * * * *

Jenkins告诉我使用H/15 * * * *而不是*/15 * * * *

Jenkins is telling me to spread load evenly by using H/15 * * * * rather than */15 * * * *

有人可以告诉我使用H而不是*的区别吗?

Could someone tell me the difference between using H instead of *?

推荐答案

是.从 构建触发器 定期构建计划→内联帮助:

Yes. From the Build TriggersBuild periodicallySchedule → inline help:

为使定期计划的任务在系统上产生均匀的负载,应尽可能使用符号H(哈希").例如,使用0 0 * * *进行许多日常工作将导致午夜时分大幅增加.相比之下,使用H H * * *仍然可以每天执行一次每个作业,但不能同时执行所有作业,最好使用有限的资源.

To allow periodically scheduled tasks to produce even load on the system, the symbol H (for "hash") should be used wherever possible. For example, using 0 0 * * * for a dozen daily jobs will cause a large spike at midnight. In contrast, using H H * * * would still execute each job once a day, but not all at the same time, better using limited resources.

H符号可以与范围一起使用.例如,H H(0-7) * * *表示介于12:00 AM(午夜)至7:59 AM之间的某个时间.您还可以将步距与H配合使用,可以使用范围,也可以不使用范围.

The H symbol can be used with a range. For example, H H(0-7) * * * means some time between 12:00 AM (midnight) to 7:59 AM. You can also use step intervals with H, with or without ranges.

可以将H符号视为一个范围内的随机值,但实际上它是作业名称的哈希,而不是随机函数,因此该值对于任何给定的项目都保持稳定.

The H symbol can be thought of as a random value over a range, but it actually is a hash of the job name, not a random function, so that the value remains stable for any given project.

请注意,对于月的天字段,由于月份长度的变化,诸如*/3H/3之类的短周期在大多数月份的末尾将无法始终如一地工作.例如,*/3将在一个月的第一天,第四天,…31天运行,然后在下个月的第二天再次运行.哈希值始终选择在1-28范围内,因此H/3在月底运行3到6天之间会产生间隔. (更长的周期也将具有不一致的长度,但效果可能相对不那么明显.)

Beware that for the day of month field, short cycles such as */3 or H/3 will not work consistently near the end of most months, due to variable month lengths. For example, */3 will run on the 1st, 4th, …31st days of a long month, then again the next day of the next month. Hashes are always chosen in the 1-28 range, so H/3 will produce a gap between runs of between 3 and 6 days at the end of a month. (Longer cycles will also have inconsistent lengths but the effect may be relatively less noticeable.)

空行和以#开头的行将被忽略为注释.

Empty lines and lines that start with # will be ignored as comments.

此外,支持@yearly@annually@monthly@weekly@daily@midnight@hourly作为方便的别名.这些使用哈希系统进行自动平衡.例如,@hourlyH * * * *相同,并且可能表示小时中的任何时间. @midnight实际上是指在12:00 AM和2:59 AM之间的某个时间.

In addition, @yearly, @annually, @monthly, @weekly, @daily, @midnight, and @hourly are supported as convenient aliases. These use the hash system for automatic balancing. For example, @hourly is the same as H * * * * and could mean at any time during the hour. @midnight actually means some time between 12:00 AM and 2:59 AM.

示例:

# every fifteen minutes (perhaps at :07, :22, :37, :52)
H/15 * * * *
# every ten minutes in the first half of every hour (three times, perhaps at :04, :14, :24)
H(0-29)/10 * * * *
# once every two hours every weekday (perhaps at 10:38 AM, 12:38 PM, 2:38 PM, 4:38 PM)
H 9-16/2 * * 1-5
# once a day on the 1st and 15th of every month except December
H H 1,15 1-11 *

这篇关于詹金斯(Jenkins)定期建造-时间表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆