Logo Knowledge
  • Product Documentation
  • Insight
  • Developer Center
  • Training
  • Submit a Request
  • Product Documentation
  • Insight
  • Developer Center
  • Training
  • Submit a Request
  1. Acquia Support Knowledge Base
  2. How-To
  3. Tips & Tricks

Cron time string format

    See more
    • Updated
    • January 21, 2021 14:23

    Scheduled Jobs in the Acquia Cloud User Interface in each environment of your application use cron to start the job(s) at specific time(s) in UTC.  If you need to set a custom string, it's helpful to have the cron time format. 

    The Cron time string format consists of five fields that Cron converts into a time interval. Cron then uses this interval to determine how often to run an associated command on your Drupal site.

    For example, a Cron time string of 0 10 15 * * executes a command on the 15th of each month at 10:00 A.M. UTC.

    Formatting

    The Cron time string is five values separated by spaces, based on the following information:

    Character Descriptor Acceptable values
    1 Minute 0 to 59, or * (no specific value)
    2 Hour 0 to 23, or * for any value. All times UTC.
    3 Day of the month 1 to 31, or * (no specific value)
    4 Month 1 to 12, or * (no specific value)
    5 Day of the week 0 to 7 (0 and 7 both represent Sunday), or * (no specific value)

    The Cron time string must contain entries for each character attribute. If you want to set a value using only minutes, you must have asterisk characters for the other four attributes that you're not configuring (hour, day of the month, month, and day of the week).

    Note that entering a value for a character attribute configures a task to run at a regular time. If you append a slash ( / ) and an integer to a wildcard in any of the character positions however, you can configure the cron task to run at a regular interval that isn't dependent on a regular time (for example, every X minutes/hours/days).

    Examples

    Use the following example to create Cron time strings you can use for your site's maintenance needs:

     

    Cron time string Description
    30 * * * * Execute a command at 30 minutes past the hour, every hour.
    0 13 * * 1 Execute a command at 1:00 p.m. UTC every Monday.
    */5 * * * * Execute a command every five minutes.
    0 */2 * * * Execute a command every second hour, on the hour.

    Acquia Products

    • Acquia Cloud

    Topics

    • cron
    Avatar
    Erin Rasmussen
    • January 21, 2021 14:23
    • Updated
    • Facebook
    • Twitter
    • LinkedIn

    Was this article helpful?
    581 out of 692 found this helpful

    Return to top

    Related articles

    • Scheduling Cron Tasks For Your Drupal Site
    • Use cURL's "--resolve" option to pin a request to an IP address
    • Using an /etc/hosts file for custom domains during development
    • Block Access to Bad Bots coming from the Huawei Cloud
    • Upgrading from PHP 7.2 to 7.3

    Support

    Acquia Support Knowledge Base
    • Submit a Request
    • Contact Support
    • Acquia Support Guide
    • Product Documentation
    • System Status

    About Acquia

    • About Us
    • Leadership
    • Board of directors
    • Newsroom
    • Careers
    • Customers
    • Contact Us
    53 State Street, 10th Floor
    Boston, MA 02109
    United States
    Phone: 888-922-7842
    Map: Google Maps
    View other locations
    • Feeds
    • Legal
    • Security Issue?

    Copyright © 2018 Acquia Inc. All Rights Reserved. Drupal is a registered trademark of Dries Buytaert.