{
  "id": 5697684,
  "title": "Crontab syntax basics, and how it differs from WP-Cron",
  "url": "https://urgent.news/2026/09/05/crontab-syntax-basics-and-how-it-differs-from-wp-cron",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-05T02:38:07.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/susumun/crontab-syntax-basics-and-how-it-differs-from-wp-cron-38ap"
  },
  "original_language": "en",
  "account": "Crontab syntax is a scheduling mechanism built into Unix-like systems such as Linux and macOS. The term is short for \"cron table,\" which is a configuration file used to list what to run and when, with each line consisting of five time fields followed by the command to execute. Each field represents a specific time unit: minute (0-59), hour (0-23, 24-hour clock), day (1-31), month (1-12), and weekday (0-7, where 0 and 7 both represent Sunday). A wildcard \"*\" can be used to signify every value for a field, meaning that a line where all five fields are \"*\" will run at any time.\n\nSome common patterns include:\n- Running something every minute: * * * * * command\n- Running something every 5 minutes: */5 * * * * command\n- Running something daily at 3:00 AM: 0 3 * * * command\n- Running something at 9:00 AM on weekdays (Monday to Friday): 0 9 * * 1-5 command\n- Running something at midnight on the 1st of every month: 0 0 1 * * command\n\nThe slash notation in */5 is known as a \"step value,\" indicating that the minute 0 will be incremented by 5 each time. The hyphen in 1-5 represents a range, which will include all the values from 1 to 5 (Monday to Friday). Specific values can also be listed using commas, such as 1,3,5. Once you're comfortable with these combinations, you should be able to express most schedules.\n\nOS-level crontab entries are managed using the command \"crontab -e\" and can be listed with \"crontab -l\". To remove the entire crontab, use \"crontab -r\". It's good practice to first run \"crontab -l\" to confirm what changes you're about to make, as \"crontab -r\" will wipe everything out at once.\n\nJobs run by cron have a minimal PATH environment variable compared to a user's interactive login shell. A command that works fine when typed manually may fail with \"command not found\" when executed by cron. To prevent this, specify the full path to the command being executed. For example, replace \"wp cron event run\" with \"/usr/local/bin/wp cron event run\" in the crontab entry.\n\nWP-Cron, on the other hand, is a scheduling mechanism built into WordPress. Unlike OS-level crontab, WP-Cron does not run on a fixed schedule but instead checks for overdue tasks every time a page is loaded in WordPress. This design is often referred to as a \"pseudo-cron\" because it depends on website traffic. A scheduled task may fail to execute on time if a website receives low traffic, particularly during off-peak hours. To overcome this limitation, you can switch to an OS-level crontab entry that periodically invokes WP-CLI to run WP-Cron tasks.",
  "summary": "\"What does */5 * * * * actually mean?\" — anyone setting up a scheduled task on a server has probably stared at that row of asterisks at some point. If you run WordPress, you may already be familiar with inspecting WP-Cron's internals through WP-CLI , but the actual crontab syntax used by the OS itself is something many people never learn properly. Before you can switch WP-Cron over to a real…",
  "key_points": [
    "Crontab syntax uses five fields for minute, hour, day, month, and weekday.",
    "Wildcard  signifies every value for a field in crontab.",
    "WP-Cron is WordPress-specific, runs on page load, not fixed schedule."
  ],
  "editors_take": "Understanding crontab syntax and its differences from WP-Cron helps users choose and configure the right scheduling tool for their needs, especially when reliability and timing are critical.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}