Pare de buscar sintaxe de Cron — há um gerador para isso
As expressões cron são um desses itens que você usa constantemente, mas raramente consiga memorizar. Aqui está o que realmente significa cada um dos cinco campos, os erros que afetam as pessoas e por que um gerador de expressão cron on-line é a abordagem mais inteligente.
It’s 2am. A deployment is scheduled for 6am. You need to double-check that the cron job will actually fire at the right time. So you open a new tab and type “cron syntax” into Google. Again.
This is a rite of passage. Every developer who has ever touched a Linux server has done it at least once — and most of us have done it more times than we care to admit. Cron expressions are one of those things you use constantly but never quite retain. The syntax sits in an uncomfortable zone between “too simple to look up” and “just specific enough to get wrong.”
There’s a better way. Use a cron expression generator online and let the tool handle the syntax while you focus on what actually matters.
Why Cron Syntax Refuses to Stick
Cron has five fields. Five. That’s it. And yet the order trips people up every single time:
# ┌───────────── minute (0–59)
# │ ┌───────────── hour (0–23)
# │ │ ┌───────────── day of month (1–31)
# │ │ │ ┌───────────── month (1–12)
# │ │ │ │ ┌───────────── day of week (0–6, Sunday=0)
# │ │ │ │ │
* * * * * command
The problem isn’t that it’s hard — it’s that there are just enough special characters to introduce ambiguity. Is */5 “every 5 minutes” or “at minute 5”? Does 0 9 * * 1-5 run at 9am or 9pm? What happens if you forget that months are 1-indexed but weekdays start at 0?
These aren’t gotchas for beginners. They’re gotchas for everyone. A misconfigured cron job is one of the quieter ways to introduce a production incident — the kind where nothing crashes immediately, it just silently doesn’t run, and you only notice three days later.
The Five Fields, Explained Without Ceremony
Here’s the practical version:
- Minute (0–59) — The minute of the hour when the job runs.
30means the 30-minute mark.*/15means every 15 minutes. - Hour (0–23) — Uses 24-hour time.
9is 9am.17is 5pm. No AM/PM nonsense. - Day of month (1–31) — Which calendar day.
1is the first of the month.15is the 15th. - Month (1–12) — January is
1, December is12. You can also use names:JAN,FEB, etc. - Day of week (0–6 or 1–7) — Sunday can be
0ou7depending on your cron implementation. Monday is always1. This is the field that causes the most confusion.
The Special Characters That Matter
*— Every possible value (every minute, every hour, etc.)*/n— Every nth interval.*/5in the minute field means every 5 minutes.a-b— A range.1-5in the weekday field means Monday through Friday.a,b,c— A list.1,3,5means Monday, Wednesday, Friday.@reboot,@hourly,@daily— Shorthand aliases. Not supported everywhere.
Common Mistakes That Bite People
1. Forgetting Timezone
Cron runs in the server’s local timezone. If your server is UTC and you’re in New York, 0 9 * * * does not run at 9am Eastern — it runs at 4am or 5am, depending on DST. Always know your server timezone. Always.
2. Using Both Day-of-Month and Day-of-Week
If you specify a value in both the day-of-month e day-of-week fields (instead of * in one of them), most cron implementations treat it as an OR — the job runs when either condition matches. That’s almost never what you want.
3. Expecting */1 to Mean “Once”
*/1 is the same as *. It means “every.” There is no way to express “run once” in standard cron — for that, you’d use at or a one-shot systemd timer.
4. Not Testing Before Deploying
Cron gives you no immediate feedback. You write the expression, save the crontab, and then wait. If it’s wrong, you find out at 3am when the scheduled backup doesn’t run. This is why using a cron next run calculator before you deploy is worth the 30 seconds it takes.
Use a Cron Expression Generator Instead
The honest advice: stop trying to hand-write cron expressions from memory. Use a generator. It’s not a sign of weakness — it’s how you avoid dumb mistakes in production.
O cron expression generator on IOTools lets you build any expression visually — pick your minute interval, hour, day of week, and it shows you the exact expression and a plain-English explanation of when it runs. No memorization required, no documentation tabs open.
Once you have an expression, run it through the cron next run calculator. Paste the expression, get back the next 5–10 scheduled execution times. It takes five seconds and will tell you immediately if you’ve accidentally scheduled your cleanup job to run every minute instead of once a day.
That second check is the one most people skip. Don’t skip it.
Quick Reference: Expressions You’ll Actually Use
| Expression | Significado |
|---|---|
* * * * * | A cada minuto |
0 * * * * | Every hour, on the hour |
0 9 * * * | Every day at 9:00am |
0 9 * * 1-5 | Weekdays at 9:00am |
*/15 * * * * | A cada 15 minutos |
0 0 * * 0 | Every Sunday at midnight |
0 0 1 * * | First day of every month at midnight |
30 4 1,15 * * | 1st and 15th of the month at 4:30am |
0 22 * * 1-5 | Weekdays at 10:00pm |
@daily | Once per day at midnight (shorthand) |
Instale nossas extensões
Adicione ferramentas de IO ao seu navegador favorito para acesso instantâneo e pesquisa mais rápida
恵 O placar chegou!
Placar é uma forma divertida de acompanhar seus jogos, todos os dados são armazenados em seu navegador. Mais recursos serão lançados em breve!
Ferramentas essenciais
Ver tudo Novas chegadas
Ver tudoAtualizar: Nosso ferramenta mais recente foi adicionado em Abr 20, 2026
