Skip to main content

Scheduled Tasks

Scheduled tasks perform periodic work such as compiling usage statistics, removing expired data, sending reminder emails, and exporting data to third-party services (e.g., registering DOIs or exporting articles to DOAJ).

CLI Commandsโ€‹

To see available options:

php lib/pkp/tools/scheduler.php usage

To list all registered scheduled tasks:

php lib/pkp/tools/scheduler.php list

To run all pending scheduled tasks immediately:

php lib/pkp/tools/scheduler.php run

To run a single specific task (useful for testing):

php lib/pkp/tools/scheduler.php test

Log Filesโ€‹

Scheduled task logs are written to <files_dir>/scheduledTaskLogs.

Configurationโ€‹

Built-in Task Runnerโ€‹

OJS 3.5+ includes a built-in task runner (the older Acron plugin has been removed).

Enable it in the [schedule] section of config.inc.php:

task_runner = On

Adjust the interval (in seconds) at which the task runner checks for work:

task_runner_interval = 60

A smaller value may negatively impact application performance.

For high-volume installations, use the operating system's task scheduler instead of the built-in runner. Add the following to your crontab (crontab -e):

* * * * * php /var/www/html/ojs/lib/pkp/tools/scheduler.php run >> /dev/null 2>&1

Once the cron job is set up, disable the built-in task runner:

task_runner = Off

Failure Notificationsโ€‹

To receive an email notification only when a scheduled task fails (instead of every run), set:

scheduled_tasks_report_error_only = On