SoftwareTestPilot
Automation TestingPublished: 7 min read

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.

Avinash Kamble
Founder & QA Engineer at SoftwareTestPilot
Reviewed by Priyanka G.
Share:XLinkedInWhatsApp

2026-07-17 · By Avinash Kamble, reviewed by Priyanka G.

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 spread

Aliases 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.

Frequently asked questions

1.Does Jenkins support seconds in cron?
No. Jenkins cron is minute-precision only. If you need sub-minute triggers, use an external scheduler (Quartz, EventBridge, k8s CronJob) to hit the Jenkins remote build URL.
2.Is H random each run?
No - that's the whole point. H is a hash of the job's full name, so it's stable across restarts but different from every other job. Rename the job and the hash changes.
3.Why is my nightly job running at a weird minute like 47?
That's H doing its job. If you truly need 00:00, use 0 0 * * * - but then don't complain when it collides with every other zero-minute job.
4.Can I use timezones in Jenkins cron?
Yes: prefix the line with TZ=Asia/Kolkata or TZ=America/New_York. Without it, Jenkins uses the controller's system timezone.
Keep going

Practice these questions

Rehearse Selenium and Playwright automation questions covering framework design, waits, locators and CI/CD.

Found this useful?
Share:XLinkedInWhatsApp

Was this article helpful?

Cluster · CI/CD

More from CI/CD Jenkins

Pipelines, agents, shared libraries.

Pillar guide · 2 articles
More in this cluster
From the CI/CD pillar

Keep building your QA edge

Continue reading

Join the QA Community

Connect with fellow testers, share job leads, and get career advice.

Premium QA Resources

Stop Reinventing the Wheel. Upgrade Your QA Arsenal.

Take your testing skills from beginner to Lead Engineer. Supercharge your daily workflow with our premium digital resources.

  • Ready-to-use testing strategy templates
  • Advanced API & UI automation guides
  • ⏱️ Save 10+ hours a week on test planning
4.9/5 rating
Explore All Products

⭐⭐⭐⭐⭐ Trusted by 1,000+ Software Test Pilots • Instant Access