Cron expression builder: automate scheduled tasks
Cron is the Unix/Linux task scheduling system that allows running commands automatically at specific times. A cron expression is a string of 5 fields that defines when a task runs.
Anatomy of a cron expression
Format: minute (0-59) | hour (0-23) | day of month (1-31) | month (1-12) | day of week (0-7). The asterisk (*) means "any value". Example: "0 9 * * 1-5" = at 9:00, Monday through Friday.
Special characters
- * — any field value.
- , — list of values (1,3,5 = Monday, Wednesday, Friday).
- - — range of values (1-5 = Monday to Friday).
- / — step or interval (*/15 in minutes = every 15 minutes).
- L — last (day of month or day of week only).
- H — hash, smart distribution (in Jenkins).
Common examples
"0 0 * * *" = every day at midnight. "0 */6 * * *" = every 6 hours. "30 8 1 * *" = first day of every month at 8:30. "0 9-17 * * 1-5" = every hour 9-17 on working days.