define cron-job --plain-english
Cron Job
TLDR:An alarm clock that runs tasks on a schedule.
The weird word throws people, so let's kill the mystery up front. "Cron" comes from chronos, the Greek word for time. That's it. A cron job is just a time job. A task you've told your computer to run on a clock, by itself, on repeat, until you tell it to stop.
Think of your sprinkler system. You don't drag the hose out at 6am every morning. You set the timer once, and it runs at 6am whether you're awake, asleep, or on a beach in Mexico. The lawn gets watered and you never think about it again. A cron job is that exact deal, for software.
You set the time once. It fires forever. Nobody presses go. You're not in the room. The clock is the boss now.
Here's the part that makes it click: a cron job answers the question when. You hand it a schedule and a task, and it just obeys.
- Every hour, on the hour.
- Every day at 9am.
- Every Monday at 5am, before you're awake.
- The first of every month.
- Every 15 minutes, all day, forever.
This is the quiet engine humming behind half the automation you already rely on. Once you can see it, you'll spot it everywhere. None of these need a human watching the clock:
The nightly backup. 2am, every night, your data gets copied somewhere safe while the office is empty.
The Monday report that's somehow already sitting in your inbox before you've had coffee.
The price check that runs every 15 minutes and pings you the second a competitor drops theirs.
The "your subscription renews in 3 days" email that goes out on the right day to the right person without anyone hitting send.
Here's where it gets good, because cron job sits right next to a couple of ideas from earlier and they snap together into something powerful.
Remember headless work? No screen, no clicking, no dashboard. A task that runs in the dark. Now bolt a cron job onto it and you've removed the last human from the loop. Headless means no one has to watch it run. Cron means no one has to start it. Stack them and you get a task that wakes itself up, does the job in the dark, and goes back to sleep. You're not even aware it happened.
A quick honest word, because "set it and forget it" has a catch. A cron job is dumb obedient. It runs whether the task still makes sense or not. If the job quietly breaks at 2am, it'll keep cheerfully running the broken version at 2am every night, and you won't know until something downstream looks wrong. So the move with anything that matters: have it tell you when it's done, or tell you when it fails. A backup that ran is good. A backup that screams at you the one night it didn't run is better.
The cleanest way to hold the difference between this and a webhook, since people mix them up:
- A webhook fires when something happens. A sale comes in, it reacts. Event-driven.
- A cron job fires when the clock says so. 9am rolls around, it runs. Time-driven.
One waits for the world to poke it. The other watches the clock and pokes itself.
Set the time once. Let it run while you live your life.