# Cron Explainer Explain a 5-field cron expression and list the next N run times. ``` python scripts/run.py "*/15 9-17 * * 1-5" python scripts/run.py "0 0 1 * *" -n 3 python scripts/run.py @daily echo "30 4 * * 6" | python scripts/run.py - ``` Pure Python stdlib (`datetime`). Supports `*`, `,`, `-`, `/` and `@aliases`. --- name: cron-explainer display_name: Cron Explainer description: "Explain a 5-field cron expression in plain English and list the next N run times. Triggers: explain cron, cron schedule, what does this cron do, crontab, next run times." --- # Cron Explainer Turn a cron expression into plain English and show when it fires next. ## When to use The user has a crontab line (`*/15 9-17 * * 1-5`) or an alias (`@daily`) and wants to know what it means and the upcoming run times. ## How to use Run `scripts/run.py` with the expression (quote it so the shell doesn't expand `*`): - `python scripts/run.py "*/15 9-17 * * 1-5"` — explain + next 5 runs. - `python scripts/run.py "0 0 1 * *" -n 3` — next 3 runs only. - `python scripts/run.py @daily` — supports `@daily`, `@hourly`, `@weekly`, `@monthly`, `@yearly`, `@midnight`. - `echo "30 4 * * 6" | python scripts/run.py -` — read from stdin. Fields are minute, hour, day-of-month, month, day-of-week and support `*`, `,`, `-`, and `/`. ## Pitfalls - Day-of-week uses 0=Sunday..6=Saturday. When both day-of-month and day-of-week are restricted, a run matches if **either** matches (standard cron OR behavior). - Next-run search iterates minute-by-minute and is capped at one year; very sparse schedules may report no run found. - Times are computed in the local timezone of the machine running the script.
Cron Explainer by langbot-team
Explain a 5-field cron expression in plain English and list the next N run times.
Loading...