T
ToolPrime

Cron Expression Generator

Create cron job schedules with an intuitive visual builder. See a plain-English explanation and the next five run times. Supports standard five-field cron syntax used by crontab, GitHub Actions, and CI/CD pipelines.

Cron Expression

* * * * *
Loading...
MinuteHourDay (Month)MonthDay (Week)

Presets

Next 5 Run Times

  1. 1Fri, Apr 3, 2026, 01:02
  2. 2Fri, Apr 3, 2026, 01:03
  3. 3Fri, Apr 3, 2026, 01:04
  4. 4Fri, Apr 3, 2026, 01:05
  5. 5Fri, Apr 3, 2026, 01:06

Cron Syntax Reference

FieldAllowed ValuesSpecial Characters
Minute0-59* , - /
Hour0-23* , - /
Day of Month1-31* , - /
Month1-12* , - /
Day of Week0-6 (Sun-Sat)* , - /

How to Use the Cron Expression Generator

  1. Select a preset or build your own schedule using the dropdowns
  2. Choose values for minute, hour, day, month, and weekday
  3. See the human-readable explanation update in real time
  4. Check the next 5 run times to verify the schedule
  5. Copy the cron expression for use in crontab, GitHub Actions, or CI/CD

What Is a Cron Expression?

A cron expression is a string of five fields separated by spaces that defines a recurring schedule for automated tasks. Originating from the Unix cron daemon introduced in the 1970s, cron syntax has become the universal standard for scheduling jobs on servers, CI/CD pipelines, cloud platforms, and container orchestration systems.

The five fields represent minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-6, where 0 is Sunday). Each field accepts specific values, ranges (1-5), lists (1,3,5), and step values (*/15). An asterisk means "every possible value." For example, */5 9-17 * * 1-5 runs every 5 minutes during business hours on weekdays. Cron expressions power everything from nightly database backups and log rotation to GitHub Actions workflows and Kubernetes CronJobs, making them essential knowledge for any developer or system administrator.

Common Use Cases

CI/CD Pipeline Scheduling

Schedule automated builds, tests, and deployments in GitHub Actions, GitLab CI, or Jenkins using cron expressions to run pipelines at specific times or intervals.

Database Backups

Configure regular database dumps using crontab entries that run daily, weekly, or at custom intervals to ensure data recovery options are always available.

Log Rotation and Cleanup

Automate log file rotation, compression, and deletion on a schedule to prevent disk space exhaustion and maintain clean server environments.

Report Generation

Schedule recurring business reports, analytics summaries, and data exports to run automatically and deliver results to stakeholders on a predictable cadence.

Cron Best Practices

Avoid the Midnight Stampede

Many jobs default to midnight (0 0 * * *), causing resource contention. Offset your jobs to less common times like 3:17 AM to spread the load.

Use UTC for Consistency

Set your cron daemon or scheduler to UTC to avoid issues with daylight saving time transitions, especially for jobs scheduled between 1-3 AM local time.

Add Overlap Protection

Use flock or a similar lock mechanism to prevent a new job instance from starting while the previous one is still running, which is common with frequent schedules.

Log and Monitor Every Job

Redirect output to log files and set up alerts for failures. Silent cron failures are one of the most common causes of undetected production issues.

Cron vs. Other Schedulers

Cron vs. Other Schedulers
SchedulerSyntaxMinimum IntervalEnvironmentBest For
crontab5-field expression1 minuteLinux/macOSServer-based recurring tasks
GitHub ActionsPOSIX cron (5 fields)5 minutesCloud CI/CDAutomated builds and deployments
systemd timerOnCalendar format1 secondLinux (systemd)Service-integrated scheduling
Kubernetes CronJobStandard cron1 minuteKubernetes clustersContainerized batch jobs
AWS EventBridgecron() or rate()1 minuteAWS cloudServerless event-driven scheduling

Frequently Asked Questions

What is cron syntax?
Cron syntax is a five-field format (minute, hour, day of month, month, day of week) used to define recurring schedules. Each field accepts specific values, ranges (1-5), lists (1,3,5), and step values (*/15). An asterisk (*) means every possible value for that field.
How do I run a cron job every 5 minutes?
Use the expression */5 * * * *. The */5 in the minute field means every 5th minute. This runs at :00, :05, :10, :15, and so on throughout every hour of every day.
What is the difference between * and ? in cron?
In standard five-field cron (used by crontab and most Linux systems), only * is used. The ? character is specific to extended cron implementations like Quartz Scheduler and AWS, where it means "no specific value" in the day-of-month or day-of-week fields.
Does this work with GitHub Actions?
Yes. GitHub Actions uses standard POSIX cron syntax with five fields. Note that GitHub Actions schedules run in UTC and the minimum interval is every 5 minutes. Use the on: schedule: - cron: syntax in your workflow YAML.
How do I set a timezone for my cron job?
Standard crontab uses the server local time. In GitHub Actions, you can set the timezone per workflow. In Kubernetes CronJobs (v1.25+), use the timeZone field. For crontab, set the TZ environment variable or use the CRON_TZ variable at the top of your crontab file.

Related Tools