Exponential does part of its work in the background: notifications, workflows, content jobs, the audit, cache cleanup, sitemaps. These run as cronjob scripts, grouped into parts, started by runcronjobs.php from cron or a systemd timer.
Parts and scripts
A part is a named list of scripts in settings/cronjob.ini, [CronjobPart-<name>] Scripts[]. The shipped frequent part runs notification.php, workflow.php, contentjobs.php, audit.php and mailbounces.php, in that order, in one process. The scripts of [CronjobSettings] Scripts[] form the default part, which runs when no part is named; the administration shows it as global. Extensions add parts of their own in their settings/cronjob.ini.append.php.
Every script takes a lock while it runs. A second run of the same script prints Cronjob part locked by other process and skips it.
Running from the shell
php runcronjobs.php --list # every part and its scripts php runcronjobs.php -s site frequent # one part, for the siteaccess site php runcronjobs.php -s site --script=notification.php ./console cron:frequent # the same through the console
Run as the site user, so the files a job writes stay writable for the web server. As root, add --allow-root-user.
Scheduling
Since 6.0.15 the installers write the crontab of a new installation themselves, in the crontab of the user that owns it, between # BEGIN Exponential cronjobs and # END Exponential cronjobs lines. On an existing installation:
php bin/php/installcrontab.php --show php bin/php/installcrontab.php --add --apply
Suggested schedules: every 5 minutes for frequent, every 15 minutes for the default part, hourly at minute 17 for infrequent, hourly for other parts. [AdminSettings] CrontabSchedule_<part> in cronjob.ini changes the schedule of a part. A typical line:
*/5 * * * * cd /var/www/example.com && php runcronjobs.php -q -s site frequent >/dev/null 2>&1
Setup > Cronjobs
The administration page (policy setup/managecronjobs, held only by Administrator in a new installation) shows one card per part: whether the crontab runs it, its schedule in words, its next and last run and its scripts. Run part and Run start a part or one script for the site you choose, and the output follows live. Only one job started from the page runs at a time. The page needs a PHP command-line binary; on a host with several PHP versions set cronjob.ini [AdminSettings] PhpCliPath.
Note: The audit log and notifications rely on the frequent part. If it does not run, alerts and mails wait.