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. |