Hello,
I having trouble scheduling a new task in this plugin directory that I have created:
/question/type/random/classes/task/
My scheduled task is not listed,
php /admin/tool/task/cli/schedule_task.php --list
and it does not appear in the web interface, either.
I cannot run the scheduled task manually.
$ php <path to>/moodle/admin/tool/task/cli/schedule_task.php --execute='<path to plugin>\classes\task\question_type_random_remove_unused_qs.php'...and I have also tried using '/' instead of '\'
Task 'classes\task\question_type_random_remove_unused_qs.php' not found
Perhaps there is a problem with my task files, so I have attached them.
I can run the cli cron,
$ sudo service cron start
[sudo] password for user:
start: Job is already running: cron
$ /usr/bin/php /path/to/moodle/admin/cli/cron.php
Cron script completed correctly
Cron completed at 20:43:41. Memory used 17.4MB.
Execution took 0.048757 seconds
and crontab appears to be setup correctly.
Although, the first time that I ran cli cron on this install, this was part of my output:
Adhoc task failed: core_course\task\course_delete_modules,Coding error detected, it must be fixed by a programmer: The course module 2 could not be deleted. #0 /var/www/html/moodle/lib/dml/moodle_database.php(1522): moodle_database->get_record_select('quiz', 'WHERE id = ?', Array, '*', 2)
...
... used 239 dbqueries
... used 0.48178696632385 seconds
Adhoc task complete: core_course\task\course_delete_modules
Cron script completed correctly
Cron completed at 16:23:04. Memory used 55.8MB.
Execution took 34.095514 seconds
That worried me a little after reading the conclusion of this dubiously related thread:
Moodle version: 3.6