
Editorial illustration; the schedule and terminal are representative, not a live Drupal installation.
A Drupal site can appear completely healthy on the surface while its background maintenance has been dead for weeks. Editors still publish articles and pages still load from cache, yet search results go stale, module update checks stop refreshing, temporary uploaded files pile up, and email or webhook queues sit untouched. Because cron runs out of sight, visitors usually notice missing search results or stuck notifications long before anyone checks the admin dashboard.
Drupal cron is not a single monolithic script. It is a hook and queue dispatcher that lets core and contributed modules run periodic work. Knowing which trigger fits your hosting environment—and how to verify that tasks actually finished—saves you from silent production drift.
What Drupal cron actually runs
Out of the box, Drupal’s cron run handles tasks like indexing new or updated nodes for Search API / core search, checking for security updates, purging expired cache bins and temporary files, and draining module queues (hook_cron() implementations and @QueueWorker plugins).
The trap is assuming that “cron ran at 02:00” means every task succeeded. A 200 OK from the cron endpoint only proves Drupal started the run. One slow external API call inside a custom module or a PHP max_execution_time limit can abort the run halfway through, leaving later hooks and queue items unexecuted while the Status report still updates the last-run timestamp.
Automated Cron vs. an external scheduler
Drupal ships with the Automated Cron core module enabled in many standard installs. It piggybacks on normal page requests: when a visitor hits a page and the configured interval (for example, 3 hours) has elapsed, Drupal runs cron at the end of that request.
For a small brochure site with steady traffic, Automated Cron works fine. Its trade-offs show up on both ends of the traffic spectrum:
- Low-traffic sites: If nobody visits your site between midnight and 8:00 AM, scheduled tasks do not run on time. If you rely on Cloudflare or aggressive page caching for anonymous users, cache hits never even reach PHP, so Automated Cron may barely fire at all.
- Busy sites: The unlucky visitor whose request triggers cron pays the latency penalty while PHP executes background maintenance.
On any site where you have SSH or hosting panel access, disabling Automated Cron (set its interval to Never or uninstall automated_cron) and using a dedicated server scheduler is far cleaner. Running cron via Drush on the CLI bypasses web server timeouts and Cloudflare’s 100-second proxy timeout (which otherwise throws a 524 error on heavy cron runs):
# Run Drupal cron every 15 minutes via Drush, logging errors
*/15 * * * * cd /var/www/drupal-site && ./vendor/bin/drush cron >> /var/log/drupal-cron.log 2>&1
If you are on shared hosting without SSH/Drush and must hit the HTTP cron URL (/cron/<cron_key>), treat that cron key like an API secret. Never commit the full URL into Git, Slack messages, or public issue trackers. Anyone who has that URL can hammer your server by triggering expensive cron runs repeatedly.
Setting up and verifying a reliable schedule
Start by opening Reports > Status report (/admin/reports/status) and Configuration > System > Cron (/admin/config/system/cron) to note the current interval and last-run timestamp. List what your site actually depends on—search indexing, Commerce subscription renewals, webform email queues, or feeds imports—so you know what a broken cron looks like.
Run cron manually once from the CLI or admin UI before automating it:
./vendor/bin/drush cron -v
./vendor/bin/drush queue:list
If drush queue:list shows thousands of stuck items, do not simply crank your cron frequency to every minute. Running heavy jobs every 60 seconds can cause overlapping PHP processes that exhaust RAM or lock database tables. Set a conservative interval (every 15 or 30 minutes is plenty for most sites), verify the first scheduled execution updated the last-run timestamp, and document where the cron job lives (root crontab, deploy user crontab, or hosting panel) so the next developer does not accidentally configure a second competing trigger.
Debugging cron by isolating the layer
When maintenance falls behind, resist the urge to clear all caches and mash “Run cron” repeatedly. Separate the failure into four layers:
- The scheduler layer: Did the server actually invoke the job? Check
/var/log/syslogorgrep CRON /var/log/syslogon Ubuntu/Debian. A wrong working directory, missing PATH forphp, or a cron job owned byrootcreating root-owned cache files can break subsequent web requests. - The HTTP/network layer (if using URL triggers): Did the request hit production or get stopped by basic auth, a staging redirect, an expired TLS certificate, or a firewall rule? Test with
curl -Ifrom the scheduler host without pasting the secret key into shared logs. - The Drupal / PHP layer: Check Reports > Recent log messages (
drush ws --severity=Error) and PHP-FPM error logs. If cron dies partway through, look for memory exhaustion (Allowed memory size exhausted) ormax_execution_timekills. - The task / queue layer: If cron runs but one specific feature lags, isolate the queue worker directly with
drush queue:run <queue_name>to see the exact exception thrown by that module.
Keeping logs useful without filling the disk
Verbose logging is great during a 10-minute debugging session, but leaving debug output on permanently can eat gigabytes of disk space on a VPS. Turn on detailed logging only while reproducing a failure, inspect the output, and dial it back once resolved. Never echo the full /cron/<key> URL into log files that are shipped to external monitoring tools.
After any fix, verify a real downstream outcome rather than trusting the Status report timestamp alone—confirm that a newly published node appears in site search or that a queued email actually left the outbound queue.
For related Drupal operational practices, see Drupal Views: When the Module Helps, When It Adds Complexity, and How to Start, Drupal Content Moderation: Build a Workflow Editors Can Trust, and Drupal Media Library: Make Reuse Easier Without Losing Control.
Cron is unglamorous plumbing, which is exactly why it gets forgotten until something breaks. A five-line note in your project README covering where the cron lives, which user owns it, and how to run drush cron manually makes handovers and incident response far calmer.