github.com/smintz/nomad@v0.8.3/website/source/docs/job-specification/periodic.html.md (about)

     1  ---
     2  layout: "docs"
     3  page_title: "periodic Stanza - Job Specification"
     4  sidebar_current: "docs-job-specification-periodic"
     5  description: |-
     6    The "periodic" stanza allows a job to run at fixed times, dates, or intervals.
     7    The easiest way to think about the periodic scheduler is "Nomad cron" or
     8    "distributed cron".
     9  ---
    10  
    11  # `periodic` Stanza
    12  
    13  <table class="table table-bordered table-striped">
    14    <tr>
    15      <th width="120">Placement</th>
    16      <td>
    17        <code>job -> **periodic**</code>
    18      </td>
    19    </tr>
    20  </table>
    21  
    22  The `periodic` stanza allows a job to run at fixed times, dates, or intervals.
    23  The easiest way to think about the periodic scheduler is "Nomad cron" or
    24  "distributed cron".
    25  
    26  ```hcl
    27  job "docs" {
    28    periodic {
    29      cron             = "*/15 * * * * *"
    30      prohibit_overlap = true
    31    }
    32  }
    33  ```
    34  
    35  The periodic expression by default evaluates in the **UTC timezone** to ensure
    36  consistent evaluation when Nomad spans multiple time zones.
    37  
    38  ## `periodic` Requirements
    39  
    40   - The job's [scheduler type][batch-type] must be `batch`.
    41  
    42  ## `periodic` Parameters
    43  
    44  - `cron` `(string: <required>)` - Specifies a cron expression configuring the
    45    interval to launch the job. In addition to [cron-specific formats][cron], this
    46    option also includes predefined expressions such as `@daily` or `@weekly`.
    47  
    48  - `prohibit_overlap` `(bool: false)` - Specifies if this job should wait until
    49    previous instances of this job have completed. This only applies to this job;
    50    it does not prevent other periodic jobs from running at the same time.
    51  
    52  - `time_zone` `(string: "UTC")` - Specifies the time zone to evaluate the next
    53    launch interval against. This is useful when wanting to account for day light
    54    savings in various time zones. The time zone must be parsable by Golang's
    55    [LoadLocation](https://golang.org/pkg/time/#LoadLocation).
    56  
    57  ## `periodic` Examples
    58  
    59  The following examples only show the `periodic` stanzas. Remember that the
    60  `periodic` stanza is only valid in the placements listed above.
    61  
    62  ### Run Daily
    63  
    64  This example shows running a periodic job daily:
    65  
    66  ```hcl
    67  periodic {
    68    cron = "@daily"
    69  }
    70  ```
    71  
    72  ### Set Time Zone
    73  
    74  This example shows setting a time zone for the periodic job to evaluate in:
    75  
    76  ```hcl
    77  periodic {
    78    cron      = "*/15 * * * * *"
    79    time_zone = "America/New_York"
    80  }
    81  ```
    82  
    83  [batch-type]: /docs/job-specification/job.html#type "Batch scheduler type"
    84  [cron]: https://github.com/gorhill/cronexpr#implementation "List of cron expressions"