Learn how to use cron to run and automate scheduled tasks on Aptible
crontab
to your repository. Here is an example crontab
you might want to adapt or reuse:
📘 For a complete crontab reference, review the documentation from the library Supercronic uses to parse crontabs, cronexpr.
📘 Unless you’ve specified otherwise with the TZ
environment variable, the schedule for your crontab will be interpreted in UTC.
Step 3: Copy the crontab
to your Docker image with a directive such as this one:
📘 The example above grabs a file namedStep 4: Add a new service (if your app already has a Procfile), or deploy a new app altogether to start Supercronic and run your cron jobs. If you are adding a service, use thiscrontab
found at the root of your repository and copies it under/app
in your image. Adjust as needed.
Procfile
declaration:
Procfile
declaration or add a CMD
declaration to your Dockerfile: