# Cron

> Cron is the Unix scheduler that runs commands at fixed times, defined with five-field cron expressions in a crontab file, also used by Kubernetes and AWS.

- Source: https://www.itwonderlab.com/cron/
- Published: 2026-09-10
- Updated: 2026-09-10
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

**Cron** is the scheduler of Linux and Unix. The `cron` service reads **crontab** files and runs each command when its time matches. The time is written as a **cron expression** of five fields: minute, hour, day of the month, month and day of the week, for example `30 2 * * *` for every day at 02:30.

### Key concepts

- **crontab**: the file with one schedule and command per line, edited with `crontab -e`.
- **Cron expression**: `* * * * *` with ranges (`1-5`), lists (`1,15`) and steps (`*/10`).
- **Environment**: cron runs with a minimal `PATH`, so use full paths in commands.
- **Same syntax elsewhere**: a [Kubernetes](https://www.itwonderlab.com/kubernetes/) `CronJob`, a [GitHub Actions](https://www.itwonderlab.com/github-actions/) `schedule` and [EventBridge](https://www.itwonderlab.com/aws-eventbridge/) rules use it, with small differences.
- **Alternative**: systemd timers.

### Learn it

Follow [Cron expressions with examples](https://www.itwonderlab.com/cron-expressions-examples/). A typical cron task is a backup with [rsync](https://www.itwonderlab.com/rsync/).
