Scheduled task via CLI not working

Scheduled task via CLI not working

by Simon Brock -
Number of replies: 1

Hi,

We are running the latest moodle 2.8.5+

As per https://docs.moodle.org/28/en/Administration_via_command_line#Scheduled_tasks

I am trying to run php scheduledtasks.php --list

firstly i received Command line scripts must define CLI_SCRIPT before requiring config.php

fixed that by adding define('CLI_SCRIPT', true); into the scheduled tasks file

now i receive !!! Unsupported redirect detected, script execution terminated !!!

has anyone else come across this?


thanks



Average of ratings: -
In reply to Simon Brock

Re: Scheduled task via CLI not working

by Ken Task -
Picture of Particularly helpful Moodlers

In 2.8.5+ (Build: 20150319) from command line as root @  moodle28code/admin/tool/task/cli/ directory as php schedule_task.php runs ok on mine.

from moodlecode directory

php admin/tool/task/cli/schedule_task.php --list

as root user also runs fine.

So maybe running wrong file?  There is a scheduledtasks.php @ /moodlecode/admin/tool/task/  Is that the one you are attempting to run? ;)

'spirit of sharing', Ken