Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,113 of 9,113 pages
About the help in other languages
All help pages

Cronjobs for builders

What runs on a schedule - cronjob parts and scripts in cronjob.ini, runcronjobs.php, the Setup > Cronjobs page and the crontab lines - and how a builder adds an existing script to a part or schedules a part.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/extension-development/part-2-builder/cronjobs-for-builders.md

On this page

Cronjobs for builders

Part 2, chapter 20. Some work happens outside a page request: resuming workflows, sending notifications, cleaning up drafts, rotating logs. Exponential groups such scripts into cronjob parts and runs them with runcronjobs.php, started by the system's crontab. This chapter is the builder's view; writing your own script is Cronjob parts in Part 3, and the complete guide is Cronjobs.

Parts and scripts

settings/cronjob.ini defines them. The scripts of the global part are in [CronjobSettings] Scripts[]; each named part is a block [CronjobPart-<name>] with its own Scripts[]. Shipped parts include:

PartScripts (shipped)Runs
globalunpublish.php, rssimport.php, indexcontent.php, hide.php, internal_drafts_cleanup.phpevery quarter hour is usual
frequentnotification.php, workflow.php, contentjobs.php, audit.php, mailbounces.phpevery few minutes
infrequentbasket_cleanup.php, linkcheck.php, mailpreferences.phphourly
contentcheck, contentjobs, audit, logsone task eachas needed

Scripts are found in the directories of [CronjobSettings] ScriptDirectories[] (the kernel's cronjobs/) and of active extensions listed in ExtensionDirectories[].

Running them

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=workflow.php # one script
php runcronjobs.php -s site                       # the global part

-q runs quietly. Run cronjobs as the user the web server runs as, so the files they write stay writable for the site.

The administration page

Setup > Cronjobs lists the parts with their scripts, runs a part or a script while you watch its output, shows recent runs and problems, and proposes crontab lines written with your installation's own path and PHP binary, for example:

*/5 * * * * cd /path/to/installation && php runcronjobs.php -q -s site frequent >/dev/null 2>&1

Nothing is added to the crontab for you: copy the lines into the crontab of the site's user (crontab -e). The schedule the page proposes can be set per part with [AdminSettings] CrontabSchedule_<part> in your cronjob.ini.append.php.

What a builder changes

Add an existing script to a part (for example a cleanup script an extension ships but no part runs):

# extension/mysite_settings/settings/cronjob.ini.append.php
[CronjobPart-infrequent]
Scripts[]=session_gc.php

A part of your own, scheduled at night:

[CronjobPart-nightly]
Scripts[]=internal_drafts_cleanup.php

[AdminSettings]
CrontabSchedule_nightly=30 3 * * *

Pause during a release: Setup > Cronjobs pauses one part (Pause on its card) or all parts until someone resumes them, and runcronjobs.php then skips them ([PauseSettings] Pause=disabled switches the check off); see Pausing cronjobs.

Checks

SymptomCheck
Articles wait for approval forever, notifications never arrivefrequent is not in the crontab
A script is listed but never runsit is in no part, or its part is not scheduled
A script runs three times in --listScriptDirectories[] names the same directory more than once; harmless for --list
Files written by cron cannot be changed by the sitecron runs as another user

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x