Cron Setup Deep-Dive

Scheduled Tasks explains the engine. This page covers the setup: the command to enter on each hosting panel, the common problems of each panel and how to check that cron really runs.

The Server tab of settings, showing the runtime numbers
This screen shows the runtime values; the schedule itself is set in your host's cron.

Read this before you install anything

Scheduled publishing already works with no cron job at all. jekcms keeps a "next job due" timestamp in its cache directory and runs the engine right after a page response has been sent to a visitor. A post set for 14:37 goes live with the first visit at or after 14:37, and that visitor does not wait. On a normal request the mechanism reads one or two small files and makes no database query.

The real question is how precise the timing needs to be. Real cron gives you three things: exact timing on a site with little traffic, background work that runs while nobody visits the site (newsletter batches, the weekly Search Console fetch, scheduled backups), and publishing that does not depend on visitors.

Cron is required only on a site with no traffic at all, including your own admin sessions. If nothing calls the site, nothing can start the engine.

jekcms detects a real cron job: each CLI run updates a freshness flag, and the visitor-triggered scheduler switches itself off for the next twenty minutes. The flag is renewed on every run. You can also force it off by defining JEK_DISABLE_PSEUDO_CRON as true in your config.

What to schedule

One command, once a minute, pointed at cron.php in your install root:

* * * * * /usr/bin/php /home/YOURUSER/public_html/cron.php >/dev/null 2>&1

Every five minutes is acceptable on a low-traffic site, but scheduled posts are then published a few minutes late; a post set for 10:00 may appear at 10:04. With longer intervals, the AI bulk-analysis worker becomes too slow, because it processes one item per run to stay inside provider rate limits.

The path to PHP varies. Try which php if you have shell access; otherwise /usr/local/bin/php and /opt/cpanel/ea-php82/root/usr/bin/php cover most shared hosts. A wrong PHP path is the most common reason why a cron job appears to run but does nothing.

cPanel

Advanced → Cron Jobs → Add New Cron Job. Pick Once per minute from the common settings dropdown and paste the command above with your own paths.

Keep >/dev/null 2>&1 in the command; without it cPanel emails you the output every minute.

Hostinger hPanel

Advanced → Cron Jobs. Use the same command, with one caveat found on Hostinger in August 2026: hPanel does not always run the command through a shell, so >/dev/null 2>&1 is not always treated as a redirection. In that case the characters are passed to the program as ordinary arguments. PHP ignores them and cron.php still runs correctly, but the output is not silenced and the notification address fills up.

If you receive an email every minute after the setup, remove the redirection from the command and clear the cron job's notification address in the panel. For the same reason, jekcms's own deploy scripts write their logs to a file themselves instead of relying on the panel's redirection.

Plesk

Tools & Settings → Scheduled Tasks → Add Task, task type Run a command:

php /var/www/vhosts/yourdomain.com/httpdocs/cron.php

Set Run to every minute and Send notifications to "Only on errors", otherwise Plesk mails you constantly. Click Run Now once after saving to check the command immediately.

DirectAdmin

Advanced Features → Cron Jobs, same crontab syntax as cPanel:

* * * * * /usr/bin/php /home/USER/domains/yourdomain.com/public_html/cron.php >/dev/null 2>&1

Linux server (crontab)

On a VPS, edit the crontab of the user that owns the files, not root. Otherwise the web server cannot read the cache and log files that cron writes:

sudo -u www-data crontab -e

Add a line that changes directory first and keeps a log you can read:

* * * * * cd /var/www/jekcms && /usr/bin/php cron.php >> logs/cron.log 2>&1

The cd is needed because some includes are resolved relative to the working directory. The log file lets you find a cron problem in seconds.

Linux + systemd timer

If you prefer journal logs and a schedule that survives reboots instead of a per-user crontab, create /etc/systemd/system/jekcms-cron.service:

[Unit]
Description=jekcms cron tick

[Service]
Type=oneshot
User=www-data
WorkingDirectory=/var/www/jekcms
ExecStart=/usr/bin/php cron.php

and /etc/systemd/system/jekcms-cron.timer:

[Unit]
Description=Run jekcms cron every minute

[Timer]
OnCalendar=*:0/1
Persistent=true

[Install]
WantedBy=timers.target

Then enable it and check the schedule:

sudo systemctl daemon-reload
sudo systemctl enable --now jekcms-cron.timer
systemctl list-timers | grep jekcms
journalctl -u jekcms-cron -n 20

Hosts with no shell and no cron panel

cron.php also accepts an HTTP trigger, but the secret is sent in a header instead of the query string, because query strings end up in access logs, browser history and Referer headers.

Define CRON_TOKEN in your config, then point an external cron service at your site with a custom header:

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

Any request without a matching token gets 403 forbidden. Most external cron services (cron-job.org, EasyCron and similar) support custom headers on the free tier.

Windows Task Scheduler

For XAMPP, WAMP or IIS installs, use Create Task instead of Create Basic Task, because only the full dialog offers a repeat every minute.

Under General, name it and tick Run whether user is logged on or not. Under Triggers, add a daily trigger starting today that repeats every 1 minute for a duration of 1 day. Under Actions, set the program to C:\xampp\php\php.exe, the argument to C:\xampp\htdocs\jekcms\cron.php, and Start in to C:\xampp\htdocs\jekcms. The last field is often forgotten, and without it relative includes fail. Under Conditions, untick Start only if the computer is on AC power, otherwise the task stops on a laptop running on battery. Under Settings, tick Run task as soon as possible after a scheduled start is missed.

Save, then right-click the task and choose Run to check that it works.

Checking that cron runs

Run the command by hand first. A CLI tick prints a timestamp, one line per step that did something, and done:

php /path/to/site/cron.php

If this works but the scheduled job does not, the problem is in the panel entry, not in jekcms. The freshness flag shows it, because the file is updated on every real run:

ls -l cache/.cron-real.flag

A modification time within the last minute or two means cron is calling cron.php. If the time is hours old or the file is missing, cron is not calling it, whatever the panel shows.

If you redirected output to a log, tail it:

tail -f logs/cron.log

To see which tasks are waiting:

SELECT type, status, scheduled_at, attempts, error_message
FROM scheduled_tasks
WHERE status IN ('pending', 'processing')
ORDER BY scheduled_at;

Rows stuck in processing for more than half an hour are picked up and reset to pending automatically the next time the queue is polled, so a crashed workflow does not block the table.

If you decide to skip cron

Scheduled publishing, the content queue and the one-off task queue keep working, because the visitor-triggered scheduler calculates its next-due time from them. They run with the first visit after the due time instead of at the exact minute.

You lose the jobs that need to run when there are no visitors. On a site that goes quiet overnight, a newsletter batch queued at 02:00 waits for the first morning reader. The nightly backup window can be missed entirely. The weekly Search Console history fetch, which feeds the Insights report, only runs if a run happens within its time window.

There is a second fallback that is separate from the scheduler: about one front-end request in fifty also moves the AI bulk-analysis worker forward. It works by chance, affects only that worker, and ensures that a site without cron still finishes a bulk SEO analysis.

In summary, a hobby blog works without cron. A site with a newsletter, a backup policy or a publishing schedule that people rely on should have a real cron job.

Be the first to know

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