Cron Special Strings: @daily, @hourly, @weekly and More
Instead of writing five time fields, cron accepts named shortcuts. @hourly runs at minute 0 of every hour, @daily (and @midnight) at 00:00, @weekly at 00:00 Sunday, @monthly at 00:00 on the 1st, and @yearly (and @annually) at 00:00 on January 1. @reboot runs once at boot.
The full table
| String | Equivalent | Fires |
|---|---|---|
@yearly / @annually | 0 0 1 1 * | Midnight, Jan 1 |
@monthly | 0 0 1 * * | Midnight, 1st of month |
@weekly | 0 0 * * 0 | Midnight Sunday |
@daily / @midnight | 0 0 * * * | Every day at 00:00 |
@hourly | 0 * * * * | Minute 0 of every hour |
@reboot | — | Once at boot |
How to use them
Put the string where the five fields would go: @daily /home/me/backup.sh. It is easier to read than 0 0 * * * and means exactly the same thing.
Caveat
These midnight jobs all pile up at 00:00. If you have several @daily jobs and they are heavy, spread them out with explicit times instead so they do not all start at once.
FAQ
What time does @daily run?
@daily runs every day at 00:00 (midnight). It is identical to the cron line 0 0 * * *.
What is the difference between @weekly and @daily?
@daily runs at midnight every day (0 0 * * *); @weekly runs only at midnight on Sunday (0 0 * * 0).
Are cron special strings portable across systems?
@hourly, @daily, @weekly, @monthly, @yearly and @reboot are supported by Vixie cron (Debian, Ubuntu, RHEL). Some minimal cron implementations may not support them, so check your cron's man page.