What is Crontab?

Cron is a time-based job scheduler built into Unix-like operating systems (Linux, macOS, BSD). It runs tasks (called cron jobs) automatically at fixed times, dates, or intervals. The name comes from Chronos, the Greek god of time.

Crontab (short for cron table) is the configuration file that tells cron what to run and when. Each user on a system can have their own crontab, and there are also system-wide crontab files for administrative tasks.

How it works

The cron daemon (crond) runs silently in the background, waking up every minute to check whether any scheduled job needs to run. If a job's schedule matches the current time, cron executes it with no manual intervention needed.

Editing your crontab

Use the crontab -e command to open and edit your personal crontab in your default text editor. Each line in the file represents one scheduled job:

┌── minute (0-59)
│  ┌── hour (0-23)
│  │  ┌── day of month (1-31)
│  │  │  ┌── month (1-12)
│  │  │  │  ┌── day of week (0-7, 0 and 7 = Sunday)
│  │  │  │  │
*  *  *  *  *   /path/to/command

Common crontab commands

User vs. system crontabs

Each user's personal crontab runs jobs as that user. System-wide cron jobs live in /etc/crontab and the /etc/cron.d/ directory, and include an extra field specifying which user runs the command.

Ready to work with cron expressions?

Translate a Cron Expression →