How Can We Help?
< All Topics
Print

Setting Up Cron Maintenance Tasks in Drupal: A Step-by-Step Guide

a) How do I configure cron maintenance tasks in Drupal ?

1. First, navigate to Reports and select Status Reports (admin/reports/status) from the Manage administrative menu to view the last run of a cron maintenance task.

The Core Automated Cron module may already run cron maintenance tasks for websites installed using the Core Standard installation profile, running approximately every three hours.

2. Then, the core Automated Cron module can be used for cron maintenance tasks, but it may not be suitable for all websites due to their specific requirements:

  • The module checks the time since the last cron maintenance task was run on a website page and, if necessary, runs it. If no visitor visits for a long time, the task is not executed.
  • Cron maintenance tasks are executed after the page is generated, allowing them to run for a shorter period before reaching server timeouts, such as PHP execution timeouts, which may result in an error message.
  • Core automation cron modules have a small scalability cost due to a web server process being tied up, preventing other web pages from being served until the cron maintenance task is completed.

3. If you want to use the core Automated Cron module, first make sure it is installed.

4. Afterwards, configure the module to control how often cron maintenance tasks run.

5. Next, navigate to Configuration to select System and click Cron (admin/config/system/cron) in the Manage administrative menu.

6. Then, select the desired interval from the Run cron every field under Cron settings and click Save Configuration.

7. Then, you can remove the core Automated Cron module to execute cron maintenance tasks from outside your website.

8. Next, the cron URL, which appears on status reports and cron management pages, is: http://www.example.com/cron/0MgWtfB33FYbbQ5UAC3L0LL3RC0PT3RNUBZILLA0Nf1Re.

The URL will be maintained through a cron task, and a scheduler will be set up to visit the URL periodically:

  • The Cron daemon (Linux, OS X, Solaris, BSD)
  • Scheduled Tasks (Windows)
  • A cron SASS provider (software as a service)
  • A cron manager provided by your web hosting provider (see the documentation
    provided by your provider)
Table of Contents