You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh-cn/docs/tasks/job/automated-tasks-with-cron-jobs.md
+58-51Lines changed: 58 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,55 +1,57 @@
1
1
---
2
2
title: 使用 CronJob 运行自动化任务
3
+
min-kubernetes-server-version: v1.21
3
4
content_type: task
4
5
weight: 10
5
-
min-kubernetes-server-version: v1.21
6
6
---
7
-
8
7
<!--
9
8
title: Running Automated Tasks with a CronJob
9
+
min-kubernetes-server-version: v1.21
10
10
reviewers:
11
11
- chenopis
12
12
content_type: task
13
13
weight: 10
14
-
min-kubernetes-server-version: v1.21
15
14
-->
16
15
17
16
<!-- overview -->
18
17
19
18
<!--
20
-
21
19
CronJobs was promoted to general availability in Kubernetes v1.21. If you are using an older version of
22
20
Kubernetes, please refer to the documentation for the version of Kubernetes that you are using,
23
21
so that you see accurate information. Older Kubernetes versions do not support the `batch/v1` CronJob API.
24
22
25
-
You can use [CronJobs](/docs/concepts/workloads/controllers/cron-jobs) to run jobs on a time-based schedule.
23
+
You can use a {{< glossary_tooltip text="CronJob" term_id="cronjob" >}} to run {{< glossary_tooltip text="Jobs" term_id="job" >}} on a time-based schedule.
26
24
These automated jobs run like [Cron](https://en.wikipedia.org/wiki/Cron) tasks on a Linux or UNIX system.
27
25
28
26
Cron jobs are useful for creating periodic and recurring tasks, like running backups or sending emails.
29
27
Cron jobs can also schedule individual tasks for a specific time, such as if you want to schedule a job for a low activity period.
All modifications to a cron job, especially its `.spec`, are applied only to the following runs.
@@ -228,15 +236,15 @@ All modifications to a cron job, especially its `.spec`, are applied only to the
228
236
The `.spec.schedule` is a required field of the `.spec`.
229
237
It takes a [Cron](https://en.wikipedia.org/wiki/Cron) format string, such as `0 * * * *` or `@hourly`, as schedule time of its jobs to be created and executed.
Executions that are suspended during their scheduled time count as missed jobs.
348
357
When `.spec.suspend` changes from `true` to `false` on an existing cron job without a [starting deadline](#starting-deadline), the missed jobs are scheduled immediately.
@@ -359,10 +368,8 @@ The `.spec.successfulJobsHistoryLimit` and `.spec.failedJobsHistoryLimit` fields
359
368
These fields specify how many completed and failed jobs should be kept.
360
369
By default, they are set to 3 and 1 respectively. Setting a limit to `0` corresponds to keeping none of the corresponding kind of jobs after they finish.
0 commit comments