Skip to main content

Cron jobs

Cron jobs are available from the Cron Jobs view in the Control Panel. Note that cron jobs are not available on all Divio plans.

Cron job management

Creating tasks

When adding a cron job, you need to provide the command that will be executed and the period during which the task should be run.

For example, if you select every 10 minutes, the task will be run every hour at :10, :20, :30, :40, :50 and :00.

A cron job can execute a simple command (for example: /usr/local/bin/python cms fix_tree) or a script.

Deployment Required

After adding or changing a cron job, the respective environment must be redeployed to apply the configuration.


Our platform lets you define a frequency for every 10 minutes, every hour or every day. If you want to run a task at longer intervals, you can set the cron job execution time to daily and restrict the execution using a script.

For example, if you would like to <execute a command> every Thursday (4th day of the week), the script could look like this

sh -c 'if [ $(date +%u) -eq 4 ]; then <execute a command>; fi'

Or if you would like to <execute a command> every 5th day of the month, the script could look as follows.

sh -c 'if [ $(date +%d) -eq 5 ]; then <execute a command>; fi'

Cron commands

Cron does not provide a fully-fledged environment - it's not a bash environment, for example, and commands that include bash syntax will not work. It can only execute commands.

Moreover, to avoid ambiguity and expected results, it is wise to be explicit. For example, in the Python example above, we specified the full Python path:


Cron job timeouts

We apply a default timeout of ten minutes on processes started by cron jobs. Longer-running processes should be handled by a more appropriate task manager (such as Celery) instead.


Cron jobs emit their logs from within the Logs section of your application:

Cron job logs