From fe40954ebde17a020061cb9816b48a5bf8e0fdb1 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Wed, 17 Oct 2018 16:51:00 -0700 Subject: [PATCH] tasks-with-cron-jobs: explain the steps expression (#10540) The `/` steps expression is used throughout this doc but is never explained. Worse, it isn't actually part of the "normal" Cron spec linked in Wikipedia and is an extension added to vixiecron --- .../docs/tasks/job/automated-tasks-with-cron-jobs.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md b/content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md index 015f209ff6..4834e7ee91 100644 --- a/content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md +++ b/content/en/docs/tasks/job/automated-tasks-with-cron-jobs.md @@ -130,6 +130,16 @@ A cron job config also needs a [`.spec` section](https://git.k8s.io/community/co The `.spec.schedule` is a required field of the `.spec`. 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. +The format also includes extended `vixie cron` step values. As explained in the [FreeBSD manual](https://www.freebsd.org/cgi/man.cgi?crontab%285%29): + +> Step values can be used in conjunction with ranges. Following a range +> with ``/'' specifies skips of the number's value through the +> range. For example, ``0-23/2'' can be used in the hours field to specify +> command execution every other hour (the alternative in the V7 standard is +> ``0,2,4,6,8,10,12,14,16,18,20,22''). Steps are also permitted after an +> asterisk, so if you want to say ``every two hours'', just use ``*/2''. + + **Note:** The question mark (`?`) in the schedule has the same meaning as an asterisk `*`, that is, it stands for any of available value for a given field. ### Job Template