Lesson 1

What Is Cron?

Scheduled jobs and where five-field Unix cron appears.

Cron is a time-based job scheduler. In Unix tradition, a cron expression (or crontab line) tells the system when to run a command or trigger a job—not what the job does.

One line, five decisions

Classic Unix cron uses five fields separated by spaces:

minute  hour  day-of-month  month  day-of-week

Example: 0 9 * * 1-5 means “at minute 0, hour 9, every day of the month, every month, on weekdays (Monday–Friday).” In plain language: 09:00 on weekdays.

The job runner evaluates the current time against each field. When all fields match, the job fires.

Where you meet cron

ContextTypical use
Linux crontab -eLog rotation, backups, cache warming
Kubernetes CronJobNamespace cleanup, report generation
GitHub Actions scheduleNightly builds, dependency scans
Managed cloud schedulersLambda/EventBridge rules (often with extensions)
Application librariesIn-process schedulers inspired by cron syntax

Not every platform uses identical five-field rules—always read that platform’s docs—but the mental model transfers.

Cron vs interval timers

“Every 5 minutes” can be expressed as */5 * * * * in cron, or as a simple interval timer in code. Cron excels when schedules align to wall-clock boundaries (every day at 02:00, first of month, weekdays at 09:00).

Interval timers excel for “every N seconds from process start.” Pick the tool that matches operational expectations.

Cron does not guarantee exactly-once

Missed runs can happen if the host was down, the previous run overran its window, or concurrency limits blocked a new start. Design jobs to be idempotent and safe if they run twice or skip once.

Key takeaway

Cron expressions are compact schedules. The next lesson breaks down each field’s grammar—*, lists, ranges, and steps—so you can read any line with confidence.

When you want to practice, use the related DevCove tool — optional, not part of this lesson.

Open related tool

Back to course overview