A CRON task executes commands automatically at regular intervals.
Example of intervals:
- every hour,
- every day day at a specific time,
- every 30 minutes
Drupal has a native CRON system but it does not allow you to manage CRON tasks individually or by group. The Ultimate Cron module allows running a CRON job or group of jobs at different times.
Drupal and CRON jobs
Drupal's core CRON job functionality does not allow running CRONs at intervals of less than 1 hour and it does not allow splitting of jobs (all CRON jobs are called at the same time).
This is a problem if you need to run CRON jobs very frequently. With the native system, you have to change your configuration to launch all your tasks very frequently. This may pose a performance issue at the server level and is arguably unnecessary. Some tasks do not need to be called as often. This module will therefore solve this problem by separating the tasks (or by grouping them) to call them at different intervals.
The Ultimate Cron module therefore offers a better alternative. For example, you can choose to call the CRON which checks for available updates only once per 24 hours and call, for example, a web services test url every 5 minutes.
- Works immediately in most cases
- Parallel execution of cron jobs
- Configuration per task (enable/disable, rules, etc.)
- Multiple rules per cron job
- Support for Drupal queues
- Status/error messages per cron job, allowing easy debugging of cron jobs
- Logs: cron job history
- hook_cron_alter() to easily add/manipulate cron jobs
- Drush support (list, start, enable/disable jobs from command line)
Download and install the module
composer require drupal/ultimate_cron
Call a CRON less than once per hour
This module is based on Drupal's CRON system. If you choose to call a CRON every minute, it won't work because Drupal can't call a CRON less than once per hour.
In this case, the simplest solution is to call the CRON url from the outside. You can find this url here: /admin/config/system/cron
For the call from outside, I used the site https://cron-job.org which is free and which allows you to launch scheduled tasks (cron) from outside the site at intervals that the can be defined (eg once every minute).