Cron Expressions Explained Écrire des horaires sans perdre la tête
Un guide pratique sur la syntaxe cron : cinq champs, des caractères spéciaux, dix expressions prêtes à l'emploi, et un générateur d'expression cron pour créer et vérifier vos programmes sans deviner.
Cron schedules tasks on Unix-like systems. The syntax — five whitespace-separated fields — looks simple until you need to run something every 15 minutes on weekdays and can’t remember whether that’s field two or three. This is the reference you keep open.
The 5-Field Format
Every cron expression has exactly five fields, separated by spaces, in this order:
┌─────────────── minute (0–59)
│ ┌─────────────── hour (0–23)
│ │ ┌─────────────── day of month (1–31)
│ │ │ ┌─────────────── month (1–12)
│ │ │ │ ┌─────────────── day of week (0–7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *
Fields Reference
| Champ | Allowed Values | Caractères spéciaux | Exemple |
|---|---|---|---|
| Minute | 0–59 | * , – / | */15 = every 15 min |
| Heure | 0–23 | * , – / | 9-17 = 9am to 5pm |
| Day of Month | 1–31 | * , – / ? | 1 = 1st of month |
| Mois | 1–12 | * , – / | */3 = every quarter |
| Day of Week | 0–7 (0=Sun) | * , – / ? | 1-5 = Mon–Fri |
Caractères spéciaux
- * — wildcard, matches any value in that field
- , — list separator:
1,3,5in day-of-week means Monday, Wednesday, Friday - – — range:
9-17in the hour field means 9am through 5pm - / — step:
*/15in the minute field means every 15 minutes;2/3means every 3rd value starting from 2 - ? — no specific value (day-of-month or day-of-week only, used by Quartz/Spring schedulers)
Common Cron Expressions
| Expression | Description |
|---|---|
* * * * * | Chaque minute |
*/5 * * * * | Toutes les 5 minutes |
*/15 * * * * | Toutes les 15 minutes |
0 * * * * | Chaque heure, à l'heure |
0 0 * * * | Chaque jour à minuit |
0 9 * * 1-5 | 9am every weekday |
0 9-17 * * 1-5 | Every hour from 9am–5pm, weekdays only |
0 0 * * 0 | Chaque dimanche à minuit |
0 0 1 * * | Midnight on the 1st of each month |
0 0 1 1 * | Midnight on January 1st |
Three Real-World Examples
1. Database backup at midnight
0 0 * * *
Minute 0, hour 0, every day. Fires once at 00:00 — clean, predictable, and out of the way during peak hours.
2. API sync every 15 minutes
*/15 * * * *
*/15 in the minute field means “step by 15, starting at 0” — fires at :00, :15, :30, and :45 of every hour. All other fields are *, so it runs around the clock.
3. Weekly cleanup — Monday at 6am
0 6 * * 1
Minute 0, hour 6, any day of month, any month, day-of-week 1 (Monday). Runs once a week. Change 1 à 5 if Fridays work better for your team.
Build and Verify Your Schedule
Memorizing every combination isn’t the point — knowing where to look is. Use the Générateur d'expression Cron to set fields visually and watch the expression form as you go. Once you have a candidate expression, paste it into the Calculateur des prochaines exécutions Cron to confirm it fires on exactly the dates and times you expect before you deploy.
Five fields, four special characters, two tools to check your work — that’s everything you need to schedule anything reliably.
Installez nos extensions
Ajoutez des outils IO à votre navigateur préféré pour un accès instantané et une recherche plus rapide
恵 Le Tableau de Bord Est Arrivé !
Tableau de Bord est une façon amusante de suivre vos jeux, toutes les données sont stockées dans votre navigateur. D'autres fonctionnalités arrivent bientôt !
Outils essentiels
Tout voir Nouveautés
Tout voirMise à jour: Notre dernier outil a été ajouté le 22 avr. 2026
