Cron Guides
Guides

What is cron? Understanding crontab basics

The core concept of the scheduler and the 5-field structure

Cron is a time-based job scheduler on Unix and Linux systems that automatically runs a command or script at set times. It's used to schedule tasks that need to repeat periodically — such as backups, log cleanup, and data synchronization — so that you don't have to run them by hand every time.

The list of jobs to run is written in a table called a crontab (cron table), one per line. Each line consists of a schedule expression that says when to run and a command that says what to run. The standard schedule expression is 5 fields separated by whitespace: minute (0-59) · hour (0-23) · day of month (1-31) · month (1-12) · day of week (0-6, 0=Sunday).

For example, 30 9 * * 1-5 means 'minute=30, hour=9, day=all, month=all, day of week=Mon-Fri', so it runs at 9:30 AM on weekdays. * means 'every value of that field', and writing something like */5 lets you specify a 'every 5' interval.

The cron daemon checks all registered expressions every minute and runs the jobs whose schedule matches the current time. That's why the shortest interval you can build with cron is one minute. If you need a shorter interval, you have to loop inside the script itself or use another approach.

As expressions get more complex, they become hard to read at a glance. If you paste an expression into the tool above, it decodes it into a human-readable sentence and previews the next run times, so you can immediately confirm whether it's the schedule you want.

Resources

Schedule collection

Copy-and-go recipes

Syntax cheat sheet

The 5 fields and special characters at a glance

Macros & aliases

Shorthand expressions like @daily

Guides

Practical guides to truly understand cron and make fewer mistakes