简体   繁体   English

整夜安排詹金斯的工作

[英]Schedule Job on jenkins over night

I've read the help in Jenkins itself and also How to schedule jobs in Jenkins? 我已经阅读了詹金斯本身的帮助,以及如何安排詹金斯的工作? .

In Jenkins you can build a job periodically by defining a cron like syntax with the addition of H (for "hash"). 在Jenkins中,您可以通过定义类似于cron的语法并添加H (用于“哈希”)来定期构建作业。

So defining 所以定义

H H(0-7) * * *

means build once between 0:00 AM and 7:00 AM. 表示在0:00 AM和7:00 AM之间构建一次。

But how can I define 1 job between 20:00 PM and 7:00 AM of the next day? 但是,如何在第二天的20:00 PM和第二天的7:00 AM之间定义1个作业?

Is there any way? 有什么办法吗?

I tried doing 我试着做

H H(20-23) * * *
H H(0-7) * * *

but ofcourse this will build two times. 但是这当然会建立两次。

Is there any possibility to make it only build once but within this time frame? 是否有可能仅在此时间范围内构建一次?

Not exactly an answer but a workarround: 不完全是一个答案,而是一种解决方法:

A possible workaround could be to simply use a shifted timezone as eg 可能的解决方法是简单地使用时区偏移,例如

My Server has Timezone MEZ which equals GMT+1 我的服务器的时区MEZ等于GMT + 1

so I could probably use something like 所以我可能会用类似

TZ=Etc/GMT+6
H H(13-23) * * *

this will run the build between 8:00 PM and 7:00 AM of the next day. 这将在第二天的8:00 PM和7:00 AM之间运行构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM