Guide

What is a cron job?

A cron job is a task that runs automatically on a schedule — every minute, every night at 2am, or once a month — without anyone clicking anything.

The short answer

Cron is the time-based scheduler built into Unix-like systems (Linux, macOS). A cron job is one entry in its schedule: a command plus the times it should run. The file holding those entries is the crontab ("cron table"). The name comes from chronos, Greek for time.

What a cron job looks like

A crontab line is a schedule followed by the command to run:

0 2 * * * /usr/bin/php /var/www/backup.php └───┬───┘ └──────────────┬─────────────┘ schedule command to run

That reads as: "at minute 0 of hour 2, every day, every month, every weekday — run the backup script." In other words, 2:00 AM every night.

How the schedule works

The schedule is five fields separated by spaces. A job runs only when every field matches the current time.

PositionFieldValues
1Minute0–59
2Hour0–23
3Day of month1–31
4Month1–12
5Day of week0–6 (Sunday = 0)

An asterisk * means "every value", so * * * * * runs every single minute. Full reference: the cron cheat sheet.

What people actually use cron jobs for

The problem nobody warns you about

Cron is reliable at starting jobs. It is terrible at telling you when they fail.

By default, cron does not notify you when a script errors, times out, or returns a 500. A broken nightly backup looks exactly like a working one — until the day you need to restore it. This is the single most common cron problem in production, and it's why silent failures can go unnoticed for weeks.

Do you still need a server?

Traditional cron runs on a machine you own and maintain. If that box is down, misconfigured, or gets rebuilt, your schedule quietly disappears with it. On shared hosting you may not even have crontab access.

A hosted cron service removes that dependency: you define the schedule and a URL or webhook, and the service calls it from its own infrastructure — logging every run and alerting you when something breaks. No server to keep alive, no crontab to migrate.

Try it without a server.
cronjobs.live runs your schedule, calls your URL, records every execution and emails you the moment one fails. Free — unlimited jobs, no credit card.
Create a free account

Related: Cron cheat sheet · How to monitor cron jobs