Les pubs vous déplaisent ? Aller Sans pub Auj.

Cron Expressions Explained Écrire des horaires sans perdre la tête

Publié le

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 Expressions Explained: Writing Schedules Without Losing Your Mind 1
ANNONCE · Supprimer ?

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

ChampAllowed ValuesCaractères spéciauxExemple
Minute0–59* , – /*/15 = every 15 min
Heure0–23* , – /9-17 = 9am to 5pm
Day of Month1–31* , – / ?1 = 1st of month
Mois1–12* , – /*/3 = every quarter
Day of Week0–7 (0=Sun)* , – / ?1-5 = Mon–Fri

Caractères spéciaux

  • * — wildcard, matches any value in that field
  • , — list separator: 1,3,5 in day-of-week means Monday, Wednesday, Friday
  • — range: 9-17 in the hour field means 9am through 5pm
  • / — step: */15 in the minute field means every 15 minutes; 2/3 means 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

ExpressionDescription
* * * * *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-59am every weekday
0 9-17 * * 1-5Every hour from 9am–5pm, weekdays only
0 0 * * 0Chaque 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.

Envie d'une expérience sans pub ? Passez à la version sans pub

Installez nos extensions

Ajoutez des outils IO à votre navigateur préféré pour un accès instantané et une recherche plus rapide

Sur Extension Chrome Sur Extension de bord Sur Extension Firefox Sur Extension de l'opéra

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 !

ANNONCE · Supprimer ?
ANNONCE · Supprimer ?
ANNONCE · Supprimer ?

Coin des nouvelles avec points forts techniques

Impliquez-vous

Aidez-nous à continuer à fournir des outils gratuits et précieux

Offre-moi un café
ANNONCE · Supprimer ?