Scheduled tasks

Hello,

I have a question related to scheduled tasks. I have a cron set up to run runScheduledTasks.php everyday in the morning. If I have the option scheduled_tasks_report_error_only set to Off, should I get some report email everyday as well? I don’t now, and the cron returns 200 status, so looks like runs ok.

Thanks,

Peter

The script runScheduledTasks.php is a command line tool, but “200 status” sounds like a HTTP result code.

How exactly are you running this script?

Please share what application and what specific version you are using in each post.

Hi @ctgraham,

my server admins provided me with ability to edit crontab through setting up individual files containing cron settings. But it only works in the case when I call a file included in a cron via url, not for cli commands. So in case of runScheduledTasks.php I have:

0 6 * * * http://xxx/tools/runScheduledTasks.php

But I don’t get any reports although I set scheduled_tasks_report_error_only to Off. Is it the correct way to set up scheduled tasks for OJS?

I use this approach for other tasks and they work.

The CLI tools should not be able to be called from the web via an HTTP request. This is intentional. In 3.x, this is handled here:

If you can run php from your cron, you would have an entry such as:

0 6 * * * php /path/to/ojs/tools/runScheduledTasks.php

You would also need separate lines for things like PLN, UsageStatistics processing, and CrossRef autoregistration.

If you do not have access to run CLI command from cron, you will need to use the acron plugin.

@ctgraham, alright, thanks, so this is why it doesn’t work for me.

I should switch back to acron plugin. Is there any control over this plugin in terms of when it triggers scheduled tasks? What is the Reload Scheduled Tasks option responsible for exactly?

Peter

The acron plugin will try to execute the tasks of which it is aware on every web access. These tasks will only be triggered if the last_runtime as recorded in the scheduled_tasks database table is earlier then “frequency” as defined in the scheduled task’s xml file.

This leaves you relatively little control over when the tasks run.

The Reload Scheduled tasks command will check the scheduled task xml files and add any new tasks into the scheduled_tasks database table to make acron aware of them.

@ctgraham, thank you for explanation.

A post was split to a new topic: Repeat Reviewers Auto Reminder