Blog
Wild & Free Tools

Cron Expressions for Jenkins Pipelines and GitLab CI

Last updated: April 2026 7 min read

Table of Contents

  1. Jenkins Cron vs Standard Cron: The H Syntax
  2. Common Jenkins Pipeline Cron Triggers
  3. Poll SCM: Cron for Source Code Polling
  4. GitLab CI Scheduled Pipelines
  5. Jenkins to GitLab Schedule Migration
  6. Building Your Jenkins or GitLab Cron Expression
  7. Frequently Asked Questions

Jenkins and GitLab CI both use cron-style scheduling — but Jenkins adds its own H (hash) syntax that standard cron tools don't support, and GitLab CI runs all schedules in UTC with no randomization option. Use our free cron expression generator to build the base 5-field expression, then adapt it to each platform's requirements below.

This guide covers Jenkins Pipeline triggers, Poll SCM, GitLab CI scheduled pipelines, and how to migrate schedules between the two platforms.

Jenkins Cron vs Standard Cron: The H Syntax

Jenkins uses standard 5-field cron syntax but adds a special H (hash) symbol. Instead of specifying an exact minute or hour, H tells Jenkins to pick a consistent but randomized value for that job. This spreads load across your Jenkins agents instead of hammering them all at the top of the hour.

PatternStandard Cron MeaningJenkins H Meaning
0 * * * *Every hour at :00Every hour at :00 (all jobs at same time)
H * * * *Not validEvery hour at a job-specific random minute
H/15 * * * *Not validEvery 15 minutes, starting at random minute
H 2 * * *Not validDaily at a random time near 2 AM
H(0-29) * * * *Not validRandom minute in first 30 minutes, every hour

Why H matters: if you have 50 pipelines all scheduled with 0 * * * *, they all trigger simultaneously. With H * * * *, Jenkins hashes each job name to a unique minute, spreading the load automatically — yet each individual job still runs at the same time every hour.

Common Jenkins Pipeline Cron Triggers

In a Jenkins Pipeline, cron schedules go inside the triggers block:

pipeline {
  triggers {
    cron('H 2 * * *')
  }
  stages { ... }
}

Common Jenkins cron patterns (use H instead of fixed minutes for production):

GoalStandard cronJenkins H equivalent
Every 15 minutes*/15 * * * *H/15 * * * *
Every hour0 * * * *H * * * *
Daily at 2 AM0 2 * * *H 2 * * *
Weekdays only at 8 AM0 8 * * 1-5H 8 * * 1-5
Weekly on Sunday0 3 * * 0H 3 * * 0
Twice daily0 6,18 * * *H 6,18 * * *

Jenkins also supports @hourly, @daily, @weekly, @monthly, and @midnight shortcuts. These automatically use H-based randomization.

Poll SCM: Cron for Source Code Polling

Jenkins "Poll SCM" checks your repository on a cron schedule and triggers a build only if changes are detected. The syntax is identical to regular cron triggers:

pipeline {
  triggers {
    pollSCM('H/5 * * * *')
  }
}

Poll SCM best practice: Use H/5 or H/10 rather than */5 to spread polling across agents. For most teams, webhooks from GitHub/GitLab are better than polling — they trigger builds immediately and put zero load on Jenkins between pushes. Use poll SCM only when webhooks aren't available (firewalled Jenkins, legacy SCM systems).

Generate the base expression with our cron generator, then replace any fixed minute with H for production Jenkins use.

Sell Custom Apparel — We Handle Printing & Free Shipping

GitLab CI Scheduled Pipelines: Standard Cron in UTC

GitLab CI scheduled pipelines use standard 5-field cron syntax with no H extension. Configure them in CI/CD → Schedules in the GitLab UI, or via the GitLab API.

Key differences from Jenkins:

GitLab CI schedule format in the UI:

Description: Nightly build
Interval Pattern: 0 2 * * *    (2 AM UTC every night)
Target Branch: main
Active: Yes

Convert your local time to UTC using our timestamp converter before setting GitLab schedules.

Migrating Cron Schedules Between Jenkins and GitLab

When migrating pipelines from Jenkins to GitLab CI (or vice versa), cron schedules need adjustment:

Jenkins → GitLab:

GitLab → Jenkins:

GoalGitLab CI (UTC)Jenkins Pipeline
Daily at 2 AM EST (UTC-5)0 7 * * *H 7 * * *
Weekdays business hours0 9-17 * * 1-5H 9-17 * * 1-5
Every 30 minutes*/30 * * * *H/30 * * * *
First of month midnight0 0 1 * *H 0 1 * *

Build Your Jenkins or GitLab Cron Expression

Use our free cron generator to build the base 5-field expression, then adapt:

  1. Set your schedule in the generator (minute, hour, day, month, weekday).
  2. Copy the output (e.g., 0 2 * * 1-5).
  3. For Jenkins: Replace fixed leading zeros with H when possible — H 2 * * 1-5.
  4. For GitLab: Confirm the hour is UTC. Use the expression as-is.
  5. Validate with the crontab visualizer to see the next 20 run times.

Jenkins H-based patterns can't be validated in standard cron tools — they're Jenkins-only syntax. Validate the equivalent standard expression (replace H with a specific number) to confirm the schedule logic is right, then convert back to H for the actual Jenkinsfile.

Try It Free — No Signup Required

Runs 100% in your browser. No account, no install, no limits.

Open Free Cron Generator

Frequently Asked Questions

Does H syntax work in GitLab CI?

No. GitLab CI uses standard POSIX cron syntax only. The H symbol is Jenkins-specific. In GitLab, you must use a specific minute value (0-59). To achieve load distribution similar to Jenkins H, manually stagger your pipeline schedules at different minutes.

How do I check what timezone my Jenkins server uses for cron?

Run a freestyle job with the shell command "date" — this shows the server's current timezone. You can also check the Jenkins system information page at /systemInfo. To change the Jenkins cron timezone, set the JENKINS_HOME/hudson.model.Hudson.cronfmt.timezone system property or configure it in the Jenkins global settings.

Can I use the same crontab for both Poll SCM and build triggers in Jenkins?

Yes — a Jenkins Pipeline can have both a cron trigger and a pollSCM trigger simultaneously. The cron trigger fires unconditionally on schedule; pollSCM fires only if changes are detected. Use both when you need guaranteed nightly builds regardless of commits (cron) plus fast feedback on pushes (pollSCM or webhooks).

Launch Your Own Clothing Brand — No Inventory, No Risk