Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Nate Stengrevics -
Number of replies: 11

I am running a new  install of Moodle 3.o. I have one course set up where course completion should occur after the three conditional activities have been checked complete. All three activities have completion check marks, however the course completion box remains unchecked. My reading led me to believe that I need CRON to update this status, so I went about installing it.


I tried to use the MoodleCron-Setup.exe for Windows as it was advertised to be the easiest method for a novice, but it doesn't appear to ever be running after install. Moodle still stays that CRON hasn't been run in the last 24 hours. I suspect I may have the URL wrong that is requested during  the installation of the CRON, but I am not really sure. Any help would be appreciated. Thanks.

Average of ratings: -
In reply to Nate Stengrevics

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Usman Asar -
Picture of Plugin developers Picture of Testers

Nate, have you looked at documentation specific to Windows Cron?

https://docs.moodle.org/30/en/Cron_with_Windows_OS



In reply to Usman Asar

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Nate Stengrevics -

Usman,

Yes, I did, and in fact I've since been able to verify that Cron is running. I had to uncheck "Cron execution via command line only" in administration and that got it working. Cron is still not marking course completion although the conditional activities are marked complete. Any thoughts?


Nate

In reply to Nate Stengrevics

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Usman Asar -
Picture of Plugin developers Picture of Testers

Nate, if activity completion is dependent upon CRON, then running manually would have solved the issue, but as it doesn't means there must be something else within the course that is stopping activity completion to show checked, do check your activities once again if something is left there.

In reply to Usman Asar

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Nate Stengrevics -

Usman,

Thank you for offering some advice. I attached a word document with screen shots from the applicable areas of Moodle where I'm trying to achieve Course Completion.

I created a course  and turned on Completion Tracking

I created a single activity within the course. It is a "File" activity which is set to be completed when a student views it.

Under Course Completion I set Condition: Activity Completion to require that the single activity be completed in order to trigger course completion.


All of the screen shots for what I just explained are in the word document.


I ran Cron this morning by navigating to the web address mysite/admin/cron.php and was successful, however, the course is still not marked complete. I am not sure where the disconnect is here, especially with a very simple, single activity course.


Nate



In reply to Nate Stengrevics

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Nate Stengrevics -

Usman,

I was able to get the course to complete but I had to manually run the Cron job through the web browser 3 times. I'm assuming the Cron package for Windows that I installed from the  Moodle site is not working, and not running the Cron every minute as I had specified at installation. The Cron exe asks for an URL to point to but I'm wondering if it should be a file location on the server instead? I would like very much to get the automatic Cron job working.



Nate

In reply to Nate Stengrevics

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Usman Asar -
Picture of Plugin developers Picture of Testers

Nate, it is indeed a file on server.

you'll be pointing to

c:/inetpub/wwwroot/moodle/admin/cli/cron.php (adjust to your path accordingly)

Running cron every minute is not required, depending on how busy is your site going to be, run every 5 minutes or even more.

Also, there are two ways to run CRON on windows platform, using PHP and using WGET, while using WGET, you'll be downloading additional DLL and wget files to run command, and using this you'll be giving URL path and not drive path.

whilst using PHP, you wont be downloading anything additional, but you'll be including path to PHP folder, like (This is what you'll be mentioning in scheduled tasks)

c:/php/php-win.exe -f c:/inetpub/wwwroot/moodle/admin/cli/cron.php

or  you can as well use

c:/php/php-win.exe -f http://www.mymoodle.com/admin/cli/cron.php

but running CRON through web interface, make sure you have unchecked the option of RUN Cron through command line only (this is by default in newer Moodle versions)

In reply to Usman Asar

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Nate Stengrevics -

I successfully ran Cron through the web browser by typing this in:   

http://ipaddress/admin/cron.php   


This works, but I'm wondering why, becuase the actual file path has an extra "cli" in it. The file path is:

c:\Moodle\MoodleWindowsInstaller-latest-30\server\moodle\admin\cli\cron.php


I have attached the picture below, where the Moodlecron.exe is asking for an URL.


Should I type in the URL that works for manual web browser Cron, http://ipaddress/admin/cron.php   ?  (maybe add in the cli)


or the file path  c:\Moodle\MoodleWindowsInstaller-latest-30\server\moodle\admin\cli\cron.php   ? (with or without cli)


Thanks for your help, I think once I know the proper URL or file path being requested by Moodelcron.exe it will work. I have already unchecked the "run Cron through command line only".


Nate


Attachment Moodlecron.exe.png
In reply to Nate Stengrevics

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Usman Asar -
Picture of Plugin developers Picture of Testers

Nate, have you been running your production Moodle on Windows installer, seriously?

if you're using the moodlecron.exe, then it will be URL to run cron through browser interface, so making it www.mymoodle.com/admin/cron.php

as CLI wont be readable by browser, or as it makes sense with MoodleCron as well, as there are remote cron services that makes use of browser based CRON tasks rather than CLI, but CLI is always more efficient in terms of load on resources.

In reply to Usman Asar

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Nate Stengrevics -

Usman,

You have been very helpful, thank you. We are looking to upgrade a large Moodle installation that is many versions behind. I have installed Moodle 3.0 on a laptop to be a "sandbox" so that I can get used to the interface as it appears in the newest version. We don't currently have access to the server for our production site, so this is all experimental work with the windows installation.


I will try using that URL again when installing the MoodleCron, although I think all the progress I made with getting the course completion to work was through manually running a Cron through the web browser.


Is there a way to check and verify that the MoodleCron is indeed running every five minutes as I will set it to do?


Nate





In reply to Nate Stengrevics

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Usman Asar -
Picture of Plugin developers Picture of Testers

Nate, as you're calling cron through browser, so just running through browser  interface should tell if you your cron is completing successfully or not, else you can as well right click the cron.php command and select RUN, you'll briefly see DOS window open and close, should there be problems, you'll see  message on command prompt.


In reply to Usman Asar

Re: Trouble with MoodleCron-Setup.exe for Windows Moodle 3.0

by Elisa Cesarei -
Hi guys,
I am writing here because I am facing the same problem Nate faced: a course made of a
single activity must be completed when the activity is completed.
The problem is the activity is marked as completed but the course is not.
I ran the cron.php through this bat file (see attached file) but when I look at the scheduled tasks I can see that no task has ever been executed (see attached screenshots).
Any suggestion ?
I would like to evitate to give commands through web for security concerns.
Attachment Scheduled_tasks_never.jpg