Automated Cron
Drupal 8 provides the Automated Cron module.
We can find this core module in core/modules/automatic_cron.
Compared to Drupal 7
Drupal 7 already had an "automated cron system," but Drupal 8 moved it into a separate module so that sites not using it wouldn’t incur any overhead.
Compared to Manual Cron
The drawback of the automated cron module is that it is triggered by a request, and an unlucky user making that request may experience a noticeable delay. For this reason, automated cron is typically used on smaller sites that cannot set up manual cron jobs using tools like Linux crontab. If crontab is needed, the Drupal console command can simplify the configuration (instead of relying on the long URL shown in /admin/config/system/cron). Here's an example of a crontab entry:
30 * * * * web_user /var/www/html/vendor/bin/drupal --root=/var/www/html/docroot cron:execute > /dev/null 2>&1
This will run Drupal cron once every hour at 30 minutes past the hour.
Drupal’s online documentation is © 2000-2020 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.