Skip to content

Commit be15df5

Browse files
authored
Merge pull request #25802 from howieyuen/cronjob
[zh] Add basic cron syntax in documentation
2 parents b45c003 + 182963a commit be15df5

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

content/zh/docs/concepts/workloads/controllers/cron-jobs.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,54 @@ This example CronJob manifest prints the current time and a hello message every
8585
[使用 CronJob 运行自动化任务](/zh/docs/tasks/job/automated-tasks-with-cron-jobs/)
8686
一文会为你详细讲解此例。
8787

88+
<!--
89+
### Cron schedule syntax
90+
-->
91+
### Cron 时间表语法
92+
93+
```
94+
# ┌───────────── 分钟 (0 - 59)
95+
# │ ┌───────────── 小时 (0 - 23)
96+
# │ │ ┌───────────── 月的某天 (1 - 31)
97+
# │ │ │ ┌───────────── 月份 (1 - 12)
98+
# │ │ │ │ ┌───────────── 周的某天 (0 - 6) (周日到周一;在某些系统上,7 也是星期日)
99+
# │ │ │ │ │
100+
# │ │ │ │ │
101+
# │ │ │ │ │
102+
# * * * * *
103+
```
104+
105+
106+
<!--
107+
| Entry | Description | Equivalent to |
108+
| ------------- | ------------- |------------- |
109+
| @yearly (or @annually) | Run once a year at midnight of 1 January | 0 0 1 1 * |
110+
| @monthly | Run once a month at midnight of the first day of the month | 0 0 1 * * |
111+
| @weekly | Run once a week at midnight on Sunday morning | 0 0 * * 0 |
112+
| @daily (or @midnight) | Run once a day at midnight | 0 0 * * * |
113+
| @hourly | Run once an hour at the beginning of the hour | 0 * * * * |
114+
-->
115+
| 输入 | 描述 | 相当于 |
116+
| ------------- | ------------- |------------- |
117+
| @yearly (or @annually) | 每年 1 月 1 日的午夜运行一次 | 0 0 1 1 * |
118+
| @monthly | 每月第一天的午夜运行一次 | 0 0 1 * * |
119+
| @weekly | 每周的周日午夜运行一次 | 0 0 * * 0 |
120+
| @daily (or @midnight) | 每天午夜运行一次 | 0 0 * * * |
121+
| @hourly | 每小时的开始一次 | 0 * * * * |
122+
123+
124+
<!--
125+
For example, the line below states that the task must be started every Friday at midnight, as well as on the 13th of each month at midnight:
126+
-->
127+
例如,下面这行指出必须在每个星期五的午夜以及每个月 13 号的午夜开始任务:
128+
129+
`0 0 13 * 5`
130+
131+
<!--
132+
To generate CronJob schedule expressions, you can also use web tools like [crontab.guru](https://crontab.guru/).
133+
-->
134+
要生成 CronJob 时间表表达式,你还可以使用 [crontab.guru](https://crontab.guru/) 之类的 Web 工具。
135+
88136
<!--
89137
## CronJob Limitations
90138

0 commit comments

Comments
 (0)