DEV Community

Cover image for Cron Expressions Explained (Without the Headache)
Andrew Rozumny
Andrew Rozumny

Posted on

Cron Expressions Explained (Without the Headache)

You see this:

*/5 * * * *
Enter fullscreen mode Exit fullscreen mode

You know it does something.

You’re just not 100% sure what.


At some point every developer has this moment:

you google “cron expression every 5 minutes”

copy something

paste it into config

and hope production doesn’t break


Here’s the thing.

Cron is not hard.

It’s just… not made for humans.


Quick examples you actually use:

Every 5 minutes:

*/5 * * * *
Enter fullscreen mode Exit fullscreen mode

Every day at midnight:

0 0 * * *
Enter fullscreen mode Exit fullscreen mode

Every Monday at 9:

0 9 * * 1
Enter fullscreen mode Exit fullscreen mode

The annoying part is not writing it.

It’s reading it later.

Especially when you come back after 2 weeks and think:

“who wrote this?”

(it was you)


Most mistakes are boring:

wrong field order

wrong timezone

misunderstanding what * really does

Nothing fancy.

Just enough to break things silently.


What helped me personally:

I stopped trying to “read” cron.

I just generate it and move on.

👉 https://tooldock.org/tools/crontab-generator


If you ever spent more than 5 minutes staring at a cron expression — you’re doing it the hard way.

Save this for later. You’ll need it.

Top comments (0)