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

Housekeeping: cronjobs and queue tables

The cronjobs that keep an Exponential database tidy and its queues moving - the parts of settings/cronjob.ini and what each script does to the database, the scripts no shipped part runs (session_gc.php, trashpurge.php…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/database-administrators/housekeeping-cronjobs-and-queues.md

On this page

Housekeeping: cronjobs and queue tables

This page is for database administrators who want to know which scheduled jobs write to the Exponential database, which queues pile up when the jobs stop, and how to check them. The cronjob system itself is described in Cronjobs; this page looks at it from the database's side. Source: settings/cronjob.ini and the scripts in cronjobs/.

Contents

  1. How cronjobs run
  2. The default part
  3. The other shipped parts
  4. Scripts that no shipped part runs
  5. Queue tables to watch
  6. Scripts outside the cron system
  7. A crontab
  8. Checklist

How cronjobs run

php runcronjobs.php [-s <siteaccess>] [<part>] runs the scripts of one part; without a part name it runs the default list in [CronjobSettings] Scripts[]. Only one instance of a script runs at a time (MaxScriptExecutionTime, 12 hours by default). Parts can be paused at Setup > Cronjobs (Cronjob console).

The default part

[CronjobSettings] Scripts[] in the shipped file:

ScriptEffect on the database
unpublish.phpunpublishes objects whose unpublish date passed
rssimport.phpimports configured RSS feeds as content
indexcontent.phpindexes content queued in ezpending_actions (delayed indexing)
hide.phphides objects whose hide date passed
internal_drafts_cleanup.phpremoves old internal drafts

The other shipped parts

PartScriptsNotes
frequentnotification.php, workflow.php, contentjobs.php, audit.php, mailbounces.phpworkflows waiting in ezworkflow_process, notifications, content jobs, the audit index
infrequentbasket_cleanup.php, linkcheck.php, mailpreferences.phpremoves old shop baskets; checks ezurl links; e-mail preference retention
cache_cleanupcachecleanup.php, httpcache_cleanup.php, querycache_cleanup.phpfiles only; querycache_cleanup.php removes old result files of the SQL query cache
cluster_maintenanceclusterpurge.phppurges expired DFS cluster entries; in ForbiddenParts[], so it cannot be launched from the browser
unlockunlock.phpreleases locks; also forbidden from the browser
contentcheck, contentjobs, audit, logs, notification, mailpreferences, mailbounces, cleanuprssone job eachrun a single job on its own schedule

Scripts that no shipped part runs

These scripts exist in cronjobs/ but are not in any part of the shipped cronjob.ini (some are listed there as comments). Add the ones you need to a part in settings/override/cronjob.ini.append.php:

ScriptPurpose
session_gc.phpremoves expired rows from ezsession (needed with ezpSessionHandlerDB)
trashpurge.phppermanently deletes objects in the trash (all, or as old as [TrashSettings] KeepItemsForDays says)
old_drafts_cleanup.phpremoves user drafts older than the configured age limit
subtreeexpirycleanup.phpcleans subtree expiry entries (commented out in the default list since 4.6)
staticcache_cleanup.phpfor the static cache, which stays disabled
updateviewcount.phpflushes the buffered view counts to the database (ezview_counter)

Read each script's header and its documentation link at Setup > Cronjobs before enabling it.

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

Queue tables to watch

TableGrows whenCheck
ezpending_actionsindexcontent.php does not runSELECT action, COUNT(*), MIN(created) FROM ezpending_actions GROUP BY action;
ezworkflow_processworkflow.php does not runrows of waiting processes
ezsessionexpired rows are not removedrows with expiration_time in the past
ezbasket, ezproductcollection*basket_cleanup.php does not runold baskets
ezcontentobject_versionold versions are never prunedbin/php/cleanupversions.php

MIN(created) is a Unix timestamp; a value hours old on a site that publishes means the queue is stuck.

Scripts outside the cron system

ScriptWhen
bin/php/cleanupversions.phpremove archived versions beyond the VersionManagement limits
bin/php/ezsessiongc.phpremove expired sessions by hand
bin/php/updatesearchindex.php --cleanrebuild the search index

A crontab

*/5 * * * *  cd /path/to/installation && umask 002 && php runcronjobs.php -q frequent
15 * * * *   cd /path/to/installation && umask 002 && php runcronjobs.php -q
30 3 * * *   cd /path/to/installation && umask 002 && php runcronjobs.php -q infrequent
45 3 * * *   cd /path/to/installation && umask 002 && php runcronjobs.php -q -s <siteaccess> cache_cleanup

Adapt the times; Setup > Cronjobs proposes lines for your installation (Cronjobs, scheduling). Run cron as the site's user, with the same umask as the site when the database is SQLite.

Checklist

  • To do: The default part, frequent and infrequent are scheduled.
  • To do: With database sessions, session_gc.php runs from a part.
  • To do: ezpending_actions and ezworkflow_process do not grow over days.
  • To do: Old versions are pruned on schedule.
  • To do: Setup > Cronjobs shows recent runs without issues.

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