Stop Running Things Manually
If you keep opening the terminal to run the same command on the same schedule, you are the cron job. It's time to fix that.
Instagram Carousel
If you keep running scripts manually, it's time. Five asterisks, one command, and your computer takes over the boring part.
Export
7 PNGs in one ZIP
If you keep opening the terminal to run the same command on the same schedule, you are the cron job. It's time to fix that.
The Pain
Every morning. Every Friday. Every deploy. You SSH in, run the thing, close the window. Until you forget once, and now there's an incident.
The Idea
A cron job is one line. Five fields that say when, followed by the command. The whole thing is shorter than this body text.
# Run every day at 6am
0 6 * * * /usr/local/bin/backup.sh
# Run every Monday at 9am
0 9 * * 1 npm run weekly-reportThe Syntax
Minute, hour, day-of-month, month, day-of-week. Use a number, a list, or a star for any. That's the whole language.
* * * * * command
| | | | |
| | | | +-- day of week (0-6, Sun=0)
| | | +----- month (1-12)
| | +-------- day of month (1-31)
| +----------- hour (0-23)
+-------------- minute (0-59)Where It Lives
The five asterisks haven't changed in decades. What changes is where you put them. Modern platforms hide the server entirely.
Gotchas
Almost everyone trips on the same two issues the first time. Knowing them upfront saves an hour of confusion.
Closing
The syntax looked scary, so you ran things by hand. Five minutes of learning it pays back every week for the rest of your career.
Tomorrow morning, something useful runs without you. Quietly. Reliably. Forever.
Slide 1 of 7