Scheduled Tasks

Every task that jekcms runs on its own (publishing a post at 14:37, sending a newsletter batch, pruning the cache, refreshing the sitemap) goes through one function: jek_cron_run() in cron.php at the root of your install. There is no task manager screen and nothing to configure. The engine decides which tasks are due, and each step checks its own conditions before it does any work, so frequent calls cost little.

The Content Studio overview, with the calendar and job counters
Planned batches, AI drafts, imports and failed jobs all report into this one view.

The engine can be started in two ways. A real cron job calls cron.php on a schedule. If you do not set one up, visitor requests start it. Both ways run the same code, so the behaviour is the same; only the timing precision differs.

The visitor-driven path

PseudoCron is checked on every front-end request. On almost all of them it only reads one or two small files from the cache directory, where it keeps a "next job due" timestamp. Until that time has passed, no database query is made.

When the time has passed, the engine runs after the response has been sent to the visitor: fastcgi_finish_request() or litespeed_finish_request() closes the connection first. On servers that cannot close the connection early, such as classic mod_php, jekcms sends a one-second request to its own cron.php?tick=1 without waiting for the answer. In both cases the visitor does not wait.

The next-due time is calculated from the three kinds of item that can become due: the earliest scheduled_at among posts in scheduled state, the earliest date/time in the content queue, and the earliest pending row in scheduled_tasks. If there are none, it checks again in five minutes. It never runs more than once per minute.

As a result, a post scheduled for 14:37 appears with the first visit at or after 14:37. The limitation is the same as for every scheduler started by visitors: on a site with no traffic at all, including your own admin sessions, nothing starts it.

The real-cron path

When cron.php runs from the command line or from an authenticated HTTP trigger, it touches a freshness flag in the cache directory. While that flag is less than twenty minutes old, PseudoCron is switched off completely, so a site with real cron has no extra cost on front-end requests. You can also force it off permanently by defining JEK_DISABLE_PSEUDO_CRON as true in your config.

Both paths share one lock file, so a slow run (a backup or a large SMTP batch) cannot overlap with the next minute's run. A second invocation prints skipped: previous run still active and exits.

Cron Setup covers installation on each hosting panel.

What the engine does

Each run goes through a fixed list. Roughly in this order, it resumes a paused AI bulk-analysis job and processes one item from it (one item per run stays well inside Gemini's per-minute limits), runs the license heartbeat if it is due, publishes scheduled posts and due content-queue items, and applies automatic core, theme and plugin updates if you turned them on (at most once a day, never on a managed install).

Then come the regular maintenance and reporting jobs: newsletter digests and campaign batches, Web Push broadcasts that ran out of time budget on an earlier run, the daily audience refresh for the CRM plugin, the weekly Google Console performance summary, the scheduled backup with its retention prune, the AI-crawler hit ingest behind the GEO report, the weekly content-refresh rescan, the weekly 404 report, the hourly trend radar, and finally the automatic maintenance sweep that expires sessions and clears stale cache and feed entries.

A few one-time repairs also run here: settings repair, integrity-manifest refresh after a deploy, creating missing image variants and content encoding repair. A marker makes each of them run only once per code version. They run in the background and need no action from you.

The one-off task queue

scheduled_tasks is a plain job table: type, a JSON payload, scheduled_at, status (pending → processing → completed or failed), attempts, max_attempts and error_message. Product features write rows into it; there is no screen for managing the table directly.

Today the type that matters is content_generation, written by Plan Many Posts and consumed over the API by an n8n workflow - see Bulk AI Generation. The Content Studio calendar surfaces those rows alongside content-queue items, so you can see a failed batch without querying the database.

The older admin/cron.php handler still exists on disk and handles several other task types. Nothing schedules it, and your cron job should not call it. Use the cron.php in your install root.

Triggering a run yourself

From the command line, which is what a real cron job should do:

php /path/to/site/cron.php

Over HTTP, for hosts without shell access, the secret is sent in a header instead of the URL, because query strings end up in access logs, browser history and Referer headers:

curl -s -H "X-Cron-Secret: YOUR_CRON_TOKEN" https://yoursite.com/cron.php

The token is the CRON_TOKEN constant in your config; the comparison is timing-safe. Without it the endpoint answers 403 forbidden and does nothing. External cron services (cron-job.org and similar) can send a custom header, which is all this endpoint needs.

There is also a keyless https://yoursite.com/cron.php?tick=1. This address is safe to expose: PseudoCron calls it itself, it is throttled to once per minute behind a file lock, and it returns {"ok":true,"skipped":"real-cron"} without doing anything when a real cron job keeps the freshness flag up to date. It is not a substitute for the authenticated trigger.

When something looks stuck

A CLI run prints one line per step, so the quickest check is to run it by hand and read the output:

php /path/to/site/cron.php

You will see [cron 2026-09-13T…], then a line for each step that did something, then done. If instead you see skipped: previous run still active, a previous run still holds the lock. This is usually a backup or a large mail batch, and sometimes a lock left behind after a process was killed.

If scheduled posts are the symptom, check the post's own scheduled_at and your site timezone under Settings → General → Localization before you check the scheduler. A wrong timezone is the most common cause of posts that are published an hour late.

Be the first to know

New features, release notes and CMS guides. We send a couple of emails a month.