Academic Tools. Smarter Research.
Open Journal SystemsDebugging OJS Scheduled Tasks & Acron

OJS Scheduled Tasks & Acron Plugin Debugging

Step-by-step diagnostic manual for OJS scheduled tasks. Learn how to replace the unreliable Acron plugin with high-performance Linux cron jobs and debug task logs.

If automated reviewer reminders, usage metrics processing, and Crossref auto-deposits stop firing, your journal’s scheduled task pipeline is broken; here is how to fix it.

Real Problem

Many journals rely on the pseudo-cron Acron plugin, which fails silently when traffic is low or when long-running tasks cause PHP script timeouts.

Practical Solution

Disable the pseudo-cron Acron plugin, implement a real Linux system crontab entry for tools/runScheduledTasks.php, and inspect scheduled_tasks database logs to resolve stuck tasks.

OJS scheduled tasks not workingOJS acron plugin debugOJS cron job setupautomate OJS email remindersPKP OJS scheduled tasks

The Engine Behind Automated Editorial Workflows

Open Journal Systems depends on background scheduled tasks to perform essential administrative functions that cannot be executed during standard web page requests:

- Sending automated reminder emails to overdue peer reviewers.

- Depositing newly published articles to Crossref via the automated DOI plugin.

- Compiling monthly COUNTER-compliant usage statistics and citation metrics.

- Purging expired session tokens and temporary cache files.

The Failure of Pseudo-Cron (The Acron Plugin)

By default, OJS includes a generic plugin called Acron. Acron is designed for shared hosting environments lacking access to Linux crontab. It hooks into incoming web traffic: whenever a visitor loads any page, Acron checks whether scheduled tasks are pending and attempts to execute them during that visitor’s request.

In production, Acron creates severe problems:

1. Editorial Delays: Low-traffic niche journals fail to execute tasks because visitors are infrequent.

2. Slow Page Loads: Unlucky visitors experience 15-second page load times while OJS processes thousands of metric logs.

3. Incomplete Execution: If the visitor closes their browser or PHP hits max_execution_time, the task dies mid-execution.

Migrating from Acron to Native Linux System Crontab

The definitive industry standard for production OJS is using real Linux cron.

Step 1: Disable the Acron Plugin

In your OJS administration dashboard, navigate to Settings > Website > Plugins > Generic Plugins. Find the Acron Plugin and uncheck "Enable".

Step 2: Verify the Command-Line Task Runner

Test the CLI task runner directly in your server terminal under the web server user:

sudo -u www-data php /var/www/ojs/tools/runScheduledTasks.php

The terminal should output:

Running scheduled tasks...

Task [CrossrefExportDeployment] complete.

Task [ReviewReminder] complete.

Step 3: Add the System Cron Schedule

Open the crontab configuration for www-data:

sudo crontab -u www-data -e

Add the following hourly cron job:

0 * * * * /usr/bin/php /var/www/ojs/tools/runScheduledTasks.php > /dev/null 2>&1

Troubleshooting Stuck Scheduled Tasks

If a task hangs or crashes, OJS will record a timestamp in the scheduled_tasks table and refuse to re-run it until the lockout period expires.

Inspect the database table:

SELECT * FROM scheduled_tasks;

To force an immediate rerun of a stuck task (such as ReviewReminder), update its last_run timestamp:

UPDATE scheduled_tasks SET last_run = '2000-01-01 00:00:00' WHERE class_name = 'classes.tasks.ReviewReminder';

Then re-execute tools/runScheduledTasks.php from the terminal.

Step-by-Step Action Plan

1

Disable Acron Plugin

Navigate to Settings > Website > Plugins and disable the Acron pseudo-cron plugin.

2

Verify CLI Execution Permissions

Confirm that php tools/runScheduledTasks.php executes cleanly in the terminal under the www-data user.

3

Create System Crontab Entry

Add 0 * * * * php /var/www/ojs/tools/runScheduledTasks.php to the crontab for the www-data user.

4

Inspect Scheduled Task Execution Logs

Review XML task files and execution records in the scheduled_tasks table to verify completion timestamps.

5

Debug Long-Running Metric Processing

Address bloated usage event logs that cause task runner timeouts by purging outdated raw log files.

Questions People Usually Ask

Why is the built-in Acron plugin unreliable for production journals?

Acron is a pseudo-cron that relies on public website visitors to trigger tasks. If a journal experiences low traffic, scheduled tasks do not run. Furthermore, if a visitor triggers a heavy task, their page load hangs until the task completes.

How often should tools/runScheduledTasks.php run in crontab?

We recommend running it once per hour (0 * * * *). For high-volume multi-journal portals, running every 15 to 30 minutes ensures rapid email dispatch and prompt Crossref deposits.

Where are scheduled task logs stored in OJS?

OJS stores execution timestamps in the scheduled_tasks database table and detailed execution XML logs inside /var/ojs_files/scheduledTaskLogs/.

Automated Reminders Not Sending in OJS?

AcademiaTech configures rock-solid system crontabs and automated task queues to keep your journal’s editorial machinery running on time.