Jenkins Cron Syntax Guide (2026) — Hash, H, and How to Stop the 3AM Stampede
Jenkins cron uses a special H (hash) symbol nobody explains well. Learn how H, H(0-30), and @midnight jitter work, with copy-paste examples for pipelines, multibranch, and shared libraries.

2026-07-17 · By Avinash K
Jenkins cron looks like POSIX cron, but it has one feature no other scheduler has: the H (hash) symbol. Used correctly, it prevents the classic problem where every job on your controller fires at exactly 0 0 * * * and grinds the queue to a halt. This guide shows how to use it properly.
The 5 fields - same as POSIX
MIN HOUR DOM MON DOW
0-59 0-23 1-31 1-12 0-7 (0 and 7 both = Sunday)Written inside a triggers { cron('...') } block in a declarative pipeline, or in the "Build periodically" box for freestyle jobs.
H - the Jenkins-only symbol that saves your controller
H tells Jenkins "pick a stable but hashed value based on the job name". Two jobs with H 2 * * * will each pick a different minute between 0 and 59 - deterministically, so they don't drift between restarts.
H * * * * # once per hour, on a hashed minute
H/15 * * * * # every 15 minutes, hashed start (0-14, 15-29, ...)
H 2 * * * # daily at 2:HH, minute hashed by job name
H H(0-7) * * * # daily some time between midnight and 7:59 AM
H H * * 1-5 # once a day on weekdays, fully spreadAliases with jitter
@hourly -> H * * * *
@daily -> H H * * *
@midnight -> H H(0-2) * * * (spreads across midnight +/- 2h)
@weekly -> H H * * H
@monthly -> H H H * *
@yearly -> H H H H *Prefer these aliases in shared libraries - every downstream job gets automatic jitter without asking.
Declarative pipeline - the copy-paste block
pipeline {
agent any
triggers {
// Nightly regression, hashed to avoid the 2 AM stampede
cron('H H(1-4) * * *')
// Poll SCM every 5 min, hashed start
pollSCM('H/5 * * * *')
}
stages {
stage('Test') { steps { sh 'npm test' } }
}
}Multibranch pipelines - cron per branch
triggers {
cron(env.BRANCH_NAME == 'main' ? 'H H(1-3) * * *' : '')
}Only main gets a nightly build; feature branches skip the schedule.
Validate before you commit
A broken cron string silently disables the trigger - Jenkins won't fail the build config, it just never fires. Before committing, paste your expression into the Cron Expression Builder & Tester to see the next 10 run times, then use the Jenkins export tab to copy the exact triggers { cron('...') } block.