jenkins - 如何每天自动执行一次詹金斯作业
问题描述
在詹金斯的工作中,我们有一个选项“定期构建”。那么在 IST 时间晚上 10:30 自动运行作业的参数是什么。
我尝试将 30 22 * * TZ=IST 作为参数,但它对我不起作用。
解决方案
单击计划框旁边的问号以获得对语法的全面解释。
它在那里说:
This field follows the syntax of cron (with minor differences). Specifically, each line consists of 5 fields separated by TAB or whitespace:
MINUTE HOUR DOM MONTH DOW
MINUTE Minutes within the hour (0–59)
HOUR The hour of the day (0–23)
DOM The day of the month (1–31)
MONTH The month (1–12)
DOW The day of the week (0–7) where 0 and 7 are Sunday.
因此,在您的情况下,您需要输入:
30 22 * * *
关于时区,文档说:
Time zone specification
Periodic tasks are normally executed at the scheduled time in the time zone of
the Jenkins master JVM (currently Europe/Berlin). This behavior can optionally
be changed by specifying an alternative time zone in the first line of the field.
Timezone specification starts with TZ=, followed by the ID of a time zone.
因此,您的完整 cron 条目是:
TZ=Asia/Istanbul
30 22 * * *
推荐阅读
- java - OpenCV java 项目在 Eclipse 中运行,但不在命令行中
- cockroachdb - 通过 JDBC 使用 cockroachdb changefeed
- oauth - 如何验证 Google OAuth JWT
- python-3.x - 如何遍历大于给定数字的数字
- ios - 错误消息“init(accessToEntityTypes:)”在初始化 EKEventStore 时不可用
- spring-data-redis - Spring redis 无法自动装配存储库
- c++ - std::string 最终会成为我们的编译时字符串吗?
- typescript - startAfter() 与 google firestore 没有按预期工作
- java - 在 Java 中实现 Prim 的 MST
- reactjs - React 不能被全局 CSS 应用