Five minutes may not seem like much time. (Unless, of course, someone asks you to hold your breath for that long.) But when it comes to scheduling cron jobs, a configuration limit of five minutes can seem interminable. Especially if your applications require or even assume that your crons run every minute.
So for those of you who have been holding your breath waiting for Platform.sh to lower our five-minute minimal interval on cron job scheduling, we’re pleased to announce that you can now define a cron schedule down to one minute for your new Enterprise and Elite projects. Existing Enterprise and Elite projects can get the new minimal interval via a support ticket.
The lines that save time
Scheduling crons jobs is simple on Platform.sh. You define the cron jobs in your Platform.sh application directly within your .platform.app.yaml
file. For example, you could configure a Magento 2 application as follows:
# Magento 2 cron job running every minute.
crons:
cronrun:
spec: "* * * * *"
cmd: "php bin/magento cron:run"
You can read more about how to use crons to schedule tasks in your Platform.sh applications in our documentation.