To help your application run more efficiently, you must conduct regular website maintenance. You can automate maintenance tasks or jobs to run at scheduled intervals using the Scheduled Jobs page in the Cloud Platform user interface. This functionality is sometimes referred to as a cron job. For more information about why you must run cron jobs regularly, see Cron automated tasks overview.
Scheduled jobs are specific to the environment where they’re created. Although you can’t create a job executing a command across several environments based on the same schedule, you can create a job for each environment, with each job using the same command line and schedule.
You must use the Scheduled Jobs page for scheduled jobs and not the default Drupal cron. Compared to Drupal cron, using the Scheduled Jobs page is more reliable, and provides support for adding extensive and integrated logging for Cloud Platform applications.
By default, Drupal cron (also known as poor man’s cron) is enabled for websites. Acquia recommends you disable Drupal cron and rely on the Cloud Platform functionality for running scheduled jobs to ensure that they will run on the schedule you specify. By contrast, Drupal’s default cron functionality is only triggered by HTTP requests and can unnecessarily keep PHP processes running for a long time, potentially causing elevated resource utilization or slower site performance. Disabling Drupal cron also enables you to avoid the performance reduction on page requests. For more information, see Automated Cron.
To disable Drupal cron:
http://[site_URL]/admin/config/system/cron).In Command frequency, select how often you want to run the command from the menus
Alternatively, you can enter the cron frequency as a string. For more information, visit Cron time string format.
For most applications on Cloud Platform, the following basic cron functionality ensures timely cron execution and essential logging of cron output:
/usr/local/bin/cron-wrapper.sh [site].[env] http://[site_URL] In this example, you will replace the above placeholders with the following information:
[site] is the name of your application on Cloud Platform.[env] is your environment (typically one of dev, test, or prod).[site_URL] is your environment’s URL (as listed on the Cloud > Domains page). If you are using Drupal multisite, your cron jobs are specific to each website in the multisite installation. Use the URL of the website in the installation you want to target.The preceding script logs the output of drush cron to a file named drush-cron.log. For example, the output file is stored in the following directory based on your infrastructure:
/shared/logs/drush-cron.log
In addition to other details, the output file contains Drush path and Drush exit code.
When creating scheduled jobs, the following limitations apply:
% character is a special character in cron commands. If your command uses this special character, be sure to precede it with a backslash (\). For example: your_log_file_$(date +\%F).log.Each job you create on the Scheduled Jobs page has links to help you manage the job, which allow you to do the following:
Some Cloud Platform Enterprise subscriptions have a dedicated cron infrastructure due to the particular performance needs of their applications. To configure a scheduled job on a dedicated cron infrastructure, contact Acquia Support. Environments running on Cloud Next technologies have dedicated cron capacity by default.
Scheduled tasks are not encrypted. Acquia recommends that scheduled tasks must not include sensitive items such as:
If this content did not answer your questions, try searching or contacting our support team for further assistance.
By default, Drupal cron (also known as poor man’s cron) is enabled for websites. Acquia recommends you disable Drupal cron and rely on the Cloud Platform functionality for running scheduled jobs to ensure that they will run on the schedule you specify. By contrast, Drupal’s default cron functionality is only triggered by HTTP requests and can unnecessarily keep PHP processes running for a long time, potentially causing elevated resource utilization or slower site performance. Disabling Drupal cron also enables you to avoid the performance reduction on page requests. For more information, see Automated Cron.
To disable Drupal cron:
http://[site_URL]/admin/config/system/cron).In Command frequency, select how often you want to run the command from the menus
Alternatively, you can enter the cron frequency as a string. For more information, visit Cron time string format.
For most applications on Cloud Platform, the following basic cron functionality ensures timely cron execution and essential logging of cron output:
/usr/local/bin/cron-wrapper.sh [site].[env] http://[site_URL] In this example, you will replace the above placeholders with the following information:
[site] is the name of your application on Cloud Platform.[env] is your environment (typically one of dev, test, or prod).[site_URL] is your environment’s URL (as listed on the Cloud > Domains page). If you are using Drupal multisite, your cron jobs are specific to each website in the multisite installation. Use the URL of the website in the installation you want to target.The preceding script logs the output of drush cron to a file named drush-cron.log. For example, the output file is stored in the following directory based on your infrastructure:
/shared/logs/drush-cron.log
In addition to other details, the output file contains Drush path and Drush exit code.
When creating scheduled jobs, the following limitations apply:
% character is a special character in cron commands. If your command uses this special character, be sure to precede it with a backslash (\). For example: your_log_file_$(date +\%F).log.Each job you create on the Scheduled Jobs page has links to help you manage the job, which allow you to do the following:
Some Cloud Platform Enterprise subscriptions have a dedicated cron infrastructure due to the particular performance needs of their applications. To configure a scheduled job on a dedicated cron infrastructure, contact Acquia Support. Environments running on Cloud Next technologies have dedicated cron capacity by default.
Scheduled tasks are not encrypted. Acquia recommends that scheduled tasks must not include sensitive items such as:
If this content did not answer your questions, try searching or contacting our support team for further assistance.