Deployment » Scheduled Tasks

Convox can set up cron-like recurring tasks on any of your application processes. This can be useful for background work like data dumps, batch jobs, or even queueing other background jobs for a worker.

Configuring timers

timers:
  cleanup:
    command: bin/cleanup
    schedule: 0 3 * * ? *
    service: web

Cron expression format

Cron expressions use the following format. All times are UTC.

.----------------- minute (0 - 59)
|  .-------------- hour (0 - 23)
|  |  .----------- day-of-month (1 - 31)
|  |  |  .-------- month (1 - 12) OR JAN,FEB,MAR,APR ...
|  |  |  |  .----- day-of-week (1 - 7) OR SUN,MON,TUE,WED,THU,FRI,SAT
|  |  |  |  |  .-- year (1970 - 2199)
|  |  |  |  |  |
*  *  *  *  *  *

Using both day-of-week and day-of-month in the same expression is not supported. One of these fields must be a ?.

Some example expressions:

Expression Meaning
* * * * ? * Run every minute
*/10 * * * ? * Run every 10 minutes
0 * * * ? * Run every hour
30 6 * * ? * Run at 6:30am UTC every day
30 18 ? * MON-FRI * Run at 6:30pm UTC every weekday
0 12 1 * ? * Run at noon on the first day of every month
0 0,12 * * ? * Run at Midnight and Noon every day

See the Scheduled Events AWS documentation for more details.