/
CI/CD

Jenkins Cron Guide

Jenkins' "Build periodically" and "Poll SCM" triggers use a cron-like syntax that's mostly standard 5-field cron, plus one genuinely useful Jenkins-specific addition: the H (hash) symbol, which spreads job start times across a range instead of having every job fire at exactly the same instant.

Syntax Notes

Standard 5-field structure, but any field can use H instead of a fixed number or *. Jenkins computes a stable hash (based on the job name) to pick a pseudo-random, consistent value within the field's range — the same job always gets the same offset, but different jobs get spread out.

Examples

Every hour, at a consistent-but-spread minute
H * * * *
Once a day, sometime between midnight and 1 AM
H H(0-1) * * *
Every 15 minutes (Jenkins style)
H/15 * * * *

Gotchas

  • Using a literal `*` in the minute field for many jobs (e.g. "every hour on the hour" for dozens of jobs) causes them all to fire at exactly :00 simultaneously, potentially overloading the Jenkins controller — H exists specifically to prevent this and should be the default choice, not *.
  • H's computed offset is deterministic per job name, so it looks 'random' but is actually stable across restarts — renaming a job changes its hash and therefore its effective schedule slightly, which can be surprising if you're tracking exact run times.
  • Poll SCM and Build periodically are separate triggers with separate cron fields — a common mistake is configuring one and expecting it to also control the other.

Best Practices

  • Default to H instead of a fixed number or * for the minute (and often hour) field on any recurring build — it costs nothing and prevents thundering-herd load spikes on shared Jenkins infrastructure.
  • Use H(0-1) style range-restricted hashes when you need a build to happen within a general window (e.g. 'sometime overnight') without needing it pinned to an exact minute.
  • For pipeline-as-code (Jenkinsfile), define the cron trigger in the `triggers { cron('H H * * *') }` block so the schedule is version-controlled alongside the pipeline itself, rather than configured only through the UI.

Frequently Asked Questions

What does H mean in a Jenkins cron expression?
H (hash) tells Jenkins to pick a pseudo-random but stable value within that field's valid range, computed from the job's name. It's used to spread out job start times and avoid many jobs firing at the exact same second.
Is Jenkins cron syntax compatible with standard cron?
Mostly — a standard 5-field cron expression without H works identically. The H character itself is a Jenkins-specific extension not understood by standard Linux cron.
How do I make a Jenkins job run every 15 minutes without clustering?
Use H/15 * * * * instead of */15 * * * * — the hash offset means your job's 15-minute cycle starts at a job-specific minute rather than always on the exact quarter-hour alongside every other job using */15.