• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Nomad
  • Install
  • Intro
  • Tutorials
  • Documentation
  • API
  • Tools
  • Plugins
  • Sign up
Nomad Home

Documentation

Skip to main content
  • Documentation


    • Overview
    • artifact
    • affinity
    • change_script
    • check
    • check_restart
    • connect
    • constraint
    • csi_plugin
    • device
    • dispatch_payload
    • env
    • ephemeral_disk
    • expose
    • gateway
    • group
    • job
    • lifecycle
    • logs
    • meta
    • migrate
    • multiregion
    • network
    • parameterized
    • periodic
    • proxy
    • reschedule
    • resources
    • restart
    • scaling
    • service
    • sidecar_service
    • sidecar_task
    • spread
    • task
    • template
    • update
    • upstreams
    • vault
    • volume
    • volume_mount
  • Schedulers

  • Nomad Ecosystem
  • Nomad Partnerships
  • Who Uses Nomad
  • FAQ

  • Resources

  • Tutorial Library
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Nomad
  3. Documentation
  4. Job Specification
  5. periodic
  • Nomad
  • v1.3.x
  • v1.2.x
  • v1.1.x
  • v1.0.x
  • v0.12.x
  • v0.11.x

»periodic Block

Placementjob -> periodic

The periodic block allows a job to run at fixed times, dates, or intervals. The easiest way to think about the periodic scheduler is "Nomad cron" or "distributed cron".

job "docs" {
  periodic {
    cron             = "*/15 * * * * *"
    prohibit_overlap = true
  }
}

The periodic expression by default evaluates in the UTC timezone to ensure consistent evaluation when Nomad spans multiple time zones.

periodic Requirements

  • The job's scheduler type must be batch or sysbatch.
  • A job can not be updated to be periodically. Thus, to transition an existing job to be periodic, you must first run nomad stop -purge «job name». This is expected behavior and is to ensure that this change has been intentionally made by an operator.

periodic Parameters

  • cron (string: <required>) - Specifies a cron expression configuring the interval to launch the job. In addition to cron-specific formats, this option also includes predefined expressions such as @daily or @weekly.

  • prohibit_overlap (bool: false) - Specifies if this job should wait until previous instances of this job have completed. This only applies to this job; it does not prevent other periodic jobs from running at the same time.

  • time_zone (string: "UTC") - Specifies the time zone to evaluate the next launch interval against. Daylight Saving Time affects scheduling, so please ensure the behavior below meets your needs. The time zone must be parsable by Golang's LoadLocation.

  • enabled (bool: true) - Specifies if this job should run. This not only prevents this job from running on the cron schedule but prevents force launches.

periodic Examples

The following examples only show the periodic blocks. Remember that the periodic block is only valid in the placements listed above.

Run Daily

This example shows running a periodic job daily:

periodic {
  cron = "@daily"
}

Set Time Zone

This example shows setting a time zone for the periodic job to evaluate in:

periodic {
  cron      = "*/15 * * * * *"
  time_zone = "America/New_York"
}

Daylight Saving Time

Though Nomad supports configuring time_zone, we strongly recommend that periodic jobs are specified with respect to UTC time_zone. Only customize time_zone when the following daylight saving time behavior is desired:

  • When leaping forward, periodic jobs scheduled for the skipped hour (eg 2:30am in America/New_York) will be skipped for that day (eg March 10th).

  • When falling back, periodic jobs scheduled for the duplicated hour (eg 1:30am in America/New_York) will be run twice for that day (eg November 3rd).

See the multiregion documentation for additional considerations when configuring time zones for periodic jobs.

Edit this page on GitHub

On this page

  1. periodic Block
  2. periodic Requirements
  3. periodic Parameters
  4. periodic Examples
  5. Daylight Saving Time
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)