Public Beta - Scalingo Scheduler - Run Scheduled Tasks

Scalingo Scheduler is here to help you run scheduled tasks at regular intervals.

The syntax used to describe this interval is the same as in the cron software.

Scalingo Scheduler launches tasks as one-off containers in detached mode. Therefore the related one-off documentation and their detached mode applies.

Defining Tasks

Scheduled tasks are defined by adding a cron.json file at the root of your application’s source code.

The file will be read at the next deployment and the tasks will be launched automatically.

It must be a valid JSON file in the format specified below.

Each job is configured as a JSON object with two keys:

  • command: contains both the cron expression and the command to execute:
    • The cron expression follows the crontab standard. You may find the website useful to write your own cron expression.
    • The command is any command you can execute in a one-off container (i.e. with the command scalingo --app my-app run <command>).
  • size: specify the container size of the one-off container executing the command. This key is optional, it defaults to M (512 MiB RAM).

All dates are expressed in UTC. For instance, if you are located in Paris or Berlin (CET timezone, UTC+1) and you want a cron job to be executed at 10:00 in your local time, your cron expression should mention 09:00. For Athens (EET, UTC+2) you would your cron expression should mention 08:00.

For instance here is a file example of how to schedule a task every morning at 8AM CET:

  "jobs": [
      "command": "0 7 * * * /bin/send-newsletter"

And here is a file example of how to schedule a task every 10 minutes to execute the command rails orders:check on a 2XL container:

  "jobs": [
      "command": "*/10 * * * * rails orders:check",
      "size": "2XL"


Scalingo Scheduler in itself is free.

The one-off containers launched to run the commands will be billed like other one-off containers.

You will be billed for the type of container you defined in your task (M is the default container size) and for the time it was executed.

For example if your task run during 5 minutes, you will be billed 5 minutes of an M container.

Long-running Tasks

Scheduled tasks are meant to execute short running tasks. Tasks are automatically killed after 15 minutes.

A one-off container started by Scalingo Scheduler will not run longer than its scheduling interval. For example, for a job that runs every 10 minutes, one-offs will be terminated after running for 10 minutes.

If your tasks may last more than the in-between interval of two tasks we suggest to use custom clock processes

Get The List Of Current Scheduled Tasks

Get the list of tasks configured on your application using the Scalingo CLI:

$ scalingo --app my-app cron-tasks
|            COMMAND              | SIZE |
| */10 * * * * rails orders:check | 2XL  |

Modify or Delete Scheduled Tasks

In order to modify or delete a cron task, you must modify or delete the associated entry in the cron.json and push your code to trigger a new deployment.

The list of tasks will be updated when the application will be redeployed.

If there is no more task, or if you want to remove all tasks, you can also remove the file.


How To Enable Scalingo Scheduler?

Scalingo Scheduler will be enabled automatically as soon as a cron.json file is present.

How To Disable Scalingo Scheduler?

Once you committed a cron.json it’s not possible to disable tasks.

If you wish to control the execution of tasks differently between environment (think about staging apps or review apps) we suggest to modify the tasks related code to detect the environment where they are executed.

How Precise Is Scalingo Scheduler?

Execution time can be delayed by a maximum of 10% of the interval between 2 tasks (up to 20 minutes).

  • */10 * * * * (every 10 minutes): task will be executed every 10 to 11 minutes
  • 0 */1 * * * (every hour): task will be executed between minute 0 and minute 6 of each hour
  • 0 0 * * *: (everyday at midnight): task will be executed between 00:00 and 00:20 UTC

This is to prevent load spikes on the infrastructure and to give time for our infrastructure to pull your application images.

If you need more precision we suggest to run a custom clock process.

Does Scalingo Scheduler work with Review Apps?

Of course, it works in the same way as the parent app.

Where can we see logs of the tasks executed?

Tasks logs are included in the application logs next to other containers logs.

Suggest edits

Public Beta - Scalingo Scheduler - Run Scheduled Tasks