Cron for Drupal

Cron is a time-based task scheduler that can be configured to automatically execute tasks without any manual involvement beyond the initial configuration.

Cron will always run unless all jobs are specifically set to 'Off' via Elysia or Ultimate Cron modules. Cron will also not run via Drush if a cron key is set with Elysia.

Both Drupal core and many contributed modules have tasks that need to be performed on a regular basis. You can configure when and how often cron executes the tasks.

Pantheon Cron Execution

Pantheon executes cron once an hour on every environment to allow Drupal to perform scheduled tasks. This generally occurs within 5 to 10 minutes of half past each hour: 4:30pm, 5:30pm, 6:30pm, etc.

Typically cron is triggered via a browser/page request or crontab. However, Pantheon uses the following to automatically trigger cron on the platform:

drush pantheon_cron 3600

Technically, the command bootstraps your site and invokes drupal_cron_run, similar to how Drupal cron runs normally.

Manage Cron

You can manage cron via Drupal's admin interface at admin/config/system/cron.

There are a couple of ways to interact with cron on Pantheon. One way is to execute cron manually from the Drupal admin interface.
Click Run cron to run all scheduled tasks.
Alternatively, you can run all scheduled cron tasks with the following Terminus command:

terminus drush <site>.<env> -- cron

To ensure that cron tasks have been run, check the reports via the Drupal Admin interface at Reports > Recent Log Messages.
If cron has run recently, entries will appear in the log. The two entries in the screenshot below show that cron has run and a cron task called "cron_example".

Run Cron More Often

While Pantheon doesn't provide a mechanism for custom scheduling of cron tasks, the platform will automatically execute drush pantheon_cron 3600 once an hour, usually within 5 to 10 minutes of half past each hour (4:30pm, 5:30pm, 6:30pm, etc).

If the site has not been accessed through the web by a visitor for at least two hours, the platform suspends the associated services until it's accessed again and cron will not run.

There is a two-part workaround; first, keeping the site awake, then using a different mechanism for executing cron tasks.

By having pingdom visit the site once a minute like a visitor, the site stays active and elysia_cron has an opportunity to act every minute (if it needs to).

This combination is not officially supported by Pantheon, but has worked for some of our customers with similar needs.

As an alternative solution if you have anything that is executing a cron on your own server, you can invoke Drush commands remotely using Terminus, including Drush cron, to trigger scheduled operations.

Another very effective solution is to leverage a service such as EasyCron. You can set custom schedules, notifications, and logging through their web interface or through their EasyCron module. The unique URL to kick off cron externally can be found at /admin/config/system/cron

Disable Cron

To disable Drupal's standard cron:

Navigate to Configuration > System > Cron within the admin interface.

Select Never from the "Run cron every" drop-down menu.

Click save configuration:

Note

This configuration disables cron execution in Drupal, but it does not affect Pantheon's cron execution at the platform level which runs every hour on all environments.

Drupal 7 sites using the Elysia Cron contrib module to extend the standard cron can globally disable it in the module's settings: