Référence complète des expressions cron avec syntaxe cron pour minutes, heures, jours, mois et jours de la semaine. Inclut des exemples courants.
| Expression | Description | Category |
|---|---|---|
* * * * * | Every minute | Frequent |
*/2 * * * * | Every 2 minutes | Frequent |
*/5 * * * * | Every 5 minutes | Frequent |
*/10 * * * * | Every 10 minutes | Frequent |
*/15 * * * * | Every 15 minutes | Frequent |
*/30 * * * * | Every 30 minutes | Frequent |
0 * * * * | Every hour (at :00) | Hourly |
30 * * * * | Every hour at :30 | Hourly |
0 */2 * * * | Every 2 hours | Hourly |
0 */4 * * * | Every 4 hours | Hourly |
0 */6 * * * | Every 6 hours | Hourly |
0 */12 * * * | Every 12 hours | Hourly |
0 0 * * * | Every day at midnight | Daily |
0 1 * * * | Every day at 1:00 AM | Daily |
0 6 * * * | Every day at 6:00 AM | Daily |
0 9 * * * | Every day at 9:00 AM | Daily |
0 12 * * * | Every day at noon | Daily |
0 18 * * * | Every day at 6:00 PM | Daily |
0 23 * * * | Every day at 11:00 PM | Daily |
0 0,12 * * * | Twice daily — midnight and noon | Daily |
0 9 * * 1 | Every Monday at 9:00 AM | Weekly |
0 9 * * 1-5 | Every weekday (Mon–Fri) at 9:00 AM | Weekly |
0 9 * * MON-FRI | Every weekday at 9 AM (named) | Weekly |
0 0 * * 0 | Every Sunday at midnight | Weekly |
0 0 * * 6,0 | Every Saturday and Sunday at midnight | Weekly |
0 8 * * 1,3,5 | Mon/Wed/Fri at 8:00 AM | Weekly |
0 0 1 * * | 1st of every month at midnight | Monthly |
0 0 15 * * | 15th of every month at midnight | Monthly |
0 0 1,15 * * | 1st and 15th of every month | Monthly |
0 0 L * * | Last day of every month (Quartz/AWS) | Monthly |
0 0 1 */3 * | Every 3 months on the 1st at midnight | Monthly |
0 0 1 1 * | January 1st at midnight (New Year) | Yearly |
0 0 1 1,7 * | January 1st and July 1st at midnight | Yearly |
0 9 * * 1#1 | First Monday of every month at 9 AM (Quartz) | Advanced |
0 0 * * 5L | Last Friday of every month (Quartz) | Advanced |
0/30 9-17 * * MON-FRI | Every 30 min 9 AM–5 PM on weekdays | Advanced |
5 4 * * sun | 5 min past 4 AM every Sunday | Advanced |
┌─────────── minute (0–59) │ ┌────────── hour (0–23) │ │ ┌───────── day of month (1–31) │ │ │ ┌──────── month (1–12 or JAN–DEC) │ │ │ │ ┌───────── day of week (0–6, Sun=0 or SUN–SAT) │ │ │ │ │ * * * * * command to execute
| Character | Name | Meaning | Example |
|---|---|---|---|
| * | Wildcard | Any value | * in hour = every hour |
| , | List separator | Multiple values | 1,15 in day = 1st and 15th |
| - | Range | From–to inclusive | 1-5 in weekday = Mon–Fri |
| / | Step | Every N units | */5 in minute = every 5 min |
| ? | No specific value | Ignore field (Quartz/AWS) | ? in day when weekday set |
| L | Last | Last day/weekday | L in day = last day of month |
| W | Weekday | Nearest weekday | 15W = nearest weekday to 15th |
| # | Nth weekday | N-th day in month | 2#1 = 1st Monday |
| Platform | Format | Example |
|---|---|---|
| Linux/macOS crontab | min hr dom mon dow | 0 9 * * 1-5 |
| GitHub Actions | min hr dom mon dow | 0 9 * * 1-5 |
| AWS EventBridge | min hr dom mon dow year | 0 9 ? * MON-FRI * |
| Quartz (Java) | sec min hr dom mon dow [year] | 0 0 9 ? * MON-FRI |
| Kubernetes CronJob | min hr dom mon dow | 0 9 * * 1-5 |
Une expression cron est une chaîne avec 5 ou 6 champs (minute, heure, jour du mois, mois, jour de la semaine et optionnellement les secondes) pour planifier des tâches automatisées sur les systèmes Unix.
L'astérisque (*) signifie 'chaque'. Par exemple, * dans le champ des minutes signifie 'chaque minute', * dans le champ des heures signifie 'chaque heure' et ainsi de suite pour chaque type de champ.
Le cron Unix/Linux standard utilise 5 champs (minute heure jour mois jour_semaine). De nombreux planificateurs modernes comme AWS EventBridge et Kubernetes CronJobs prennent en charge 6 champs avec un champ de secondes optionnel au début ou à la fin.
Utilisez: 0 9 * * 1-5. Cela signifie minute=0, heure=9, n'importe quel jour du mois, n'importe quel mois, jour de la semaine lundi(1) à vendredi(5).