Cron special strings: @reboot, @daily, @hourly and when to use them

Most cron daemons support eight special strings as shorthand for common schedules: @reboot, @yearly, @annually, @monthly, @weekly, @daily, @midnight, and @hourly. They're easier to read than numeric expressions but hide important details about exactly when the job runs.

Schedule pattern
Cron special strings
special-strings
Category
Common Patterns
Standard cron expression patterns

How this is calculated

@reboot runs once at system startup. It's uniquely useful because there's no numeric cron expression for run once after boot. @daily and @midnight both expand to 0 0 * * *. @hourly expands to 0 * * * *. @weekly expands to 0 0 * * 0. @monthly expands to 0 0 1 * *. @yearly and @annually both expand to 0 0 1 1 *. The catch: these shortcuts only work in system-level crontabs (/etc/crontab) and user crontabs on systems running Vixie cron or cronie (most Linux distributions). They don't work in BusyBox cron (Alpine Linux, minimal containers) or on macOS (which uses launchd, not cron, by default). For portable scripts and Docker containers, use explicit 5-field expressions.

Verdict

@reboot is the one special string genuinely worth using because it has no numeric equivalent. @daily and friends are fine for personal Linux servers but avoid them in portable scripts, Dockerfiles, and anything that might run under BusyBox. Explicit expressions always work.

More Cron scenarios

Frequently asked questions

What is a Cron Job?
A cron job is a scheduled task that runs automatically on a Unix-like operating system (like Linux or macOS) at specific intervals. It is heavily used by developers to run background tasks like database backups, cache clearing, or sending nightly emails.
What do the 5 parts of a cron expression mean?
From left to right, the 5 fields are: Minute (0-59), Hour (0-23), Day of the Month (1-31), Month (1-12), and Day of the Week (0-6, where 0 and 7 are Sunday).
What does the asterisk (*) mean in Cron?
The asterisk acts as a wildcard, meaning 'every'. For example, if the minute field is an asterisk, the task runs every single minute. If the month field is an asterisk, the task runs every single month.
How do I run a task every 5 minutes?
To run a task every 5 minutes, use the slash operator in the minute field like this: */5 * * * *. The */5 means 'every 5th minute'.