This article provides an overview of CRON and includes detailed examples of common CRON timings to help users automate and schedule tasks efficiently in Unix-like systems.

Last updated: 9 Oct 2025

Reading time: 7 minutes

CRON stands for Command Run On Notice.

The term CRON is derived from the Greek word chronos, which means time. This reflects its primary function as a time-based job scheduler. The name emphasizes its role in executing commands or tasks at specified intervals based on time.

CRON is a time-based job scheduler in Unix-like operating systems, including Linux and macOS. It is commonly used to automate the execution of scripts, commands, and other programs at specified intervals, whether that’s minutes, hours, days, weeks, or even specific dates. CRON jobs are particularly useful for routine tasks that need to be performed regularly without manual intervention.

CRON consists of 2 parts:

  • CRON daemon (crond), a background service that continuously runs on the server, checking the CRON schedule files for any tasks that need to be executed.
  • CRON table (crontab), a configuration file that contains the schedule of CRON jobs. Each line in the crontab file represents a job, specifying the command to be executed and the schedule on which it should run.

Common uses of CRON

  • Website management: Running tasks like clearing caches, updating content, or refreshing API data at scheduled times.
  • Manually triggering of WordPress Scheduler tasks: By default, some tasks don’t run often enough or run at inopportune times (e.g., scheduled sale price updates in WooCommerce). CRON allows you to schedule these individually to run on your schedule.
  • Automated backups: Regularly backing up files, databases, or entire websites.
  • System maintenance: Cleaning up temporary files, log rotation, or checking for updates.
  • Email notifications: Sending out periodic email reports or alerts.

CRON vs. WP-CRON

CRON is part of the operating system, where WP-CRON is a system that is built into WordPress, which manages the scheduling of time-based tasks with code.

Several core features of WordPress, such as checking for updates and publishing scheduled posts, rely on WP-CRON, which checks the list of scheduled tasks each time a page is loaded to determine which tasks need to be executed. Any tasks that are due to run are triggered during that page load.

CRON time syntax

CRON uses a specific syntax to define when a job should run. The syntax includes five fields representing minute, hour, day of the month, month, and day of the week, separated by a single space:

* * * * * command_to_run

  • Minute: (0 – 59)
  • Hour: (0 – 23)
  • Day of Month: (1 – 31)
  • Month: (1 – 12)
  • Day of Week: (0 – 6 where 0 represents Sunday. 7 also represents Sunday)

Each field can be set to a specific value, a range, or an asterisk (*), which represents “every possible value” for that field.

You can specify CRON to run a job more than once at specific times or days by adding a comma and more numbers to the value. To run a CRON job at specific intervals or times per unit, use a forward slash (/).

Manage CRON notifications and output

By default, you should receive an email notification when a job completes. If you want to disable these notifications, add the following to the end of your CRON task:

>/dev/null 2>&1

This prevents the sending of errors and output, by redirecting output to /dev/null, instead of via email.

Examples

Run script and disable notifications:

* * * * * command_to_run >/dev/null 2>&1

Run script and output to a log file:

* * * * * command_to_run >/path/to/logs/my_cron.log 2>&1

Clear SiteGround Optimizer cache and disable notifications:

0 5 * * * wp --path=/home/customer/www/yourdomain.com/public_html sg purge >/dev/null 2>&1

Clear SiteGround Optimizer cache and output to a log file:

0 5 * * * wp --path=/home/customer/www/yourdomain.com/public_html sg purge >/home/customer/www/yourdomain.com/logs/my_cron.log 2>&1

CRON schedule examples

The table below shows some common use cases.

Example Description Explanation
* * * * * Every minute This CRON job runs every minute of every hour, every day.
0 * * * * Every hour Runs at the start of every hour (e.g., 12:00, 1:00, 2:00, etc.).
0 0 * * * Daily at midnight Runs once a day at midnight (00:00).
0 12 * * * Daily at noon Runs once a day at 12:00 PM (noon).
0 0 * * 0 Every Sunday at midnight Runs once a week at midnight on Sunday.
0 0 1 * * Monthly on the first day at midnight Runs once a month at midnight on the first day of the month.
0 0 1 1 * Annually on January 1st at midnight Runs once a year at midnight on January 1st.
0 0 1 * 1 First Monday of every month at midnight Runs at midnight on the first Monday of each month.
0 0 * * 1-5 Weekdays at midnight Runs every weekday (Monday to Friday) at midnight.
0 8-18 * * * Hourly between 8 AM and 6 PM Runs every hour, on the hour, between 8:00 AM and 6:00 PM (inclusive).
*/15 * * * * Every 15 minutes Runs every 15 minutes (e.g., 0:00, 0:15, 0:30, 0:45, etc.).
*/5 9-17 * * * Every 5 minutes during working hours Runs every 5 minutes between 9:00 AM and 5:55 PM.
0 0 1,15 * * On the 1st and 15th of every month at midnight Runs twice a month, at midnight on the 1st and the 15th.
0 0 1 6,12 * Annually on June 1st and December 1st at midnight Runs twice a year, at midnight on June 1st and December 1st.
30 2 * * 1 Every Monday at 2:30 AM Runs once a week at 2:30 AM on Monday.
0 22 * * 1-5 Weekdays at 10 PM Runs every weekday (Monday to Friday) at 10:00 PM.
0 */2 * * * Every 2 hours Runs every two hours (e.g., 12:00, 2:00, 4:00, etc.).
0 23-7/2 * * * Every 2 hours between 11 PM and 7 AM Runs every 2 hours starting at 11:00 PM through to 7:00 AM (inclusive) (e.g., 11:00 PM, 1:00 AM, etc.).
30 1 * * 2,4 Every Tuesday and Thursday at 1:30 AM Runs twice a week at 1:30 AM on Tuesday and Thursday.

About the Author: Stephan

With 20 years of industry experience as a UX specialist, designer and developer, I enjoy teaching and sharing insights about UX, accessibility and best practices for e-commerce and the web.

Related insights