I will eventually have more than one Moodle running on my server, so whatever I choose to use has to account for that
I'm on windows server 2016, php 7.2 and IIS 10
I have tried to set up the cron as a scheduled task. - now I've read the bit that says avoid using a browser to run the cron and that I should disable that, so that put me off using the wget option.
So I've been trying the other - as per https://docs.moodle.org/35/en/Cron_with_Windows_OS
c:\php\php-win.exe -f c:\moodle\admin\cli\cron.php adjusted to be appropriate to my server.
It fails every time so I tried running the log file output and all it says in the log file is
off c:\php\php-win.exe -f c:\moodle\admin\cli\cron.php
what is that trying to tell me, I don't understand.
I can actually get the wget version as a batch file to run as a scheduled task, but then I can't tell if it has actually worked because on the moodle site it only says
The cli/cron.php maintenance script has not been run for at least 24 hours - which is correct because I can't make that one work at all.
Am I safe or is it insecure using the wget?
in Edit Action window, use the following commands
Program/Script (you can browse to your file as well) --- using your location as example
c:\php\php.exe (not the php-win.exe)
and in add arguments (optional), use this command
Also, in general settings tab, do select Run with highest privileges, as well select Run whether user is logged in or not
I've tried and it errors every time. Last run result 0x1 and the history gives operational code (2).
I've checked permissions on the account running the task and I'm sure it is set right, but I've no idea why it isn't working. Read and Execute on the c:\moodle\admin\cli\cron.php, read and execute on c:\php\php.exe
I have tried running the task manually from the command line (different log on account) and it does work, so it is definitely something in the task scheduling that is doing it.
In case anybody else gets this, definitely permissions of some sort.
At the minute I can only get the task to run when run from a domain admin account which is not a sensible account for running a scheduled task, but at least it proves the scheduled task works so thank you for your suggestion. Just need to work out what the domain has that the task account does not.