Cron

Cron

Cron is a service on servers that automatically starts programs at fixed times – for example every night at three o'clock. The individual tasks are called cron jobs and are described in a text file using five time specifications.

On a computer that runs continuously and provides services on the internet, many tasks need to be carried out on a regular basis. A backup copy of the data should be created every night. Old files should be deleted every Sunday. Nobody wants to get up at three in the morning and press a button to make that happen. Cron is a small program that handles exactly this: it runs constantly in the background, checks the clock every minute, and starts the tasks scheduled for that point in time. A single such task is called a cron job. The name comes from the Greek word chronos, meaning time.

The reason servers keep working at night

Almost every piece of software operated on the internet has tasks that nobody wants to trigger by hand. Invoices are generated on the first of the month. Newsletters go out on Tuesdays at ten o’clock. Databases are cleaned up at night, when few users are online. Without a scheduler, a human would have to trigger all of this, reliably, for years on end, even on holidays.

Cron is therefore one of the oldest and most widely used components there is. It has been part of Unix systems since the 1970s, and thus today it’s found in practically every Linux server. The technology has barely changed, because it simply does its job well. Anyone dealing with the operation of software cannot avoid it.

This also plays a role in the AI space. Models need to be supplied with fresh data, usage statistics get tallied up, search indexes get rebuilt. Such maintenance runs are rarely spectacular, but when they fail, you notice quickly: the search returns outdated results, the morning report is missing.

Five asterisks as a schedule

The schedules are stored in a text file called the crontab. Each line describes one job and consists of five time specifications plus the command to be executed. The five specifications stand for minute, hour, day of the month, month, and day of the week – always in that order. An asterisk means “every value”.

An example: “0 3 * * *” means minute zero, hour three, every day, every month, every day of the week. So the command runs daily at 3:00 a.m. If you write “*/15 * * * *” instead, it starts every fifteen minutes. This terse notation seems cryptic at first, but is quickly learned and is also understood by many other programs.

What matters is what cron does not do. It does not check whether the previous run has already finished. If a job starts every five minutes but takes ten, the runs overlap. Cron also doesn’t remember anything: if the server was switched off at three o’clock, the job is not made up for later. And error messages don’t automatically land with someone who reads them. This is exactly where many cron jobs fail in practice – they run silently into the void.

From the command line to the cloud

You encounter cron directly on Linux machines. The command “crontab -e” opens your personal list of jobs. Even a Raspberry Pi at home uses this, for instance to save sensor readings every hour. On Windows, the counterpart is called Task Scheduler and works on the same principle, just with clicks instead of asterisks.

In modern cloud environments, the idea lives on under new names. The container system Kubernetes has what it calls CronJobs, GitHub offers scheduled workflows, Amazon and Google have their own schedulers. Almost all of them adopt the five asterisks unchanged. Once you know the notation, you’ll recognize it everywhere.

In the news, the term usually comes up when something has gone wrong. A forgotten cron job deletes production data, a billing run fails to execute, a backup ran into the void for months. That’s why companies now actively monitor their jobs: if a job doesn’t report back in time, an alert goes out.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.