I was looking into what scripts is the cron job executing, and two of them were ldap and cas syncs. I went in those php files ( /opt/moodle/enrol/ldap/cli/sync.php and /opt/moodle/auth/cas/cli/sync_users.php) and saw that for ldap it was calling the method sync_enrolments(), and in cas it was calling sync_users(). The same methods are used in the scheduled tasks scripts though, so my question is, what is the difference if I were to have them as scheduled tasks vs cron jobs?
Thank you in advance!
Think Moodle is transitioning towards all scheduled task (Gui Run Now/CLI) rather than one cron job.
Don't run LDAP anymore ... never ran CAS ... but sounds like one requires the other in your setup ... comment: the location of moodle in /opt/ as opposed to 'standard' Ubuntu or CentOS or other Linux indicates your setup is different than most LAMP boxen.
The cron job does actually call the task by the scheduling in the task list. When I used LDAP I did have to schedule the LDAP sync more frequently at the beginning of the first academic semester cause new students were still being enrolled. This to ask how often do your people update LDAP/CAS and expect those credentials to be used in the Moodle? (wanted it yesterday?)
Anything found in a CLI directory is command line only ... no browser.
CLI directories could be handy if one wanted to setup their own cron job for whatever and for whatever reason.
That clear as mud?
'spirit of sharing', Ken
The Moodle cron job and scheduled tasks are closely related. When Moodle's cron job runs, it looks up the scheduled tasks and runs the ones that are due.
There is another thing which confuses this, because plugins can also specify their own task to be run on cron in their version.php file. I don't know what the name for this is, but lets say its the "Cron task." This is really a legacy thing and we should be using scheduled tasks now. This cron task thing could not be controlled by admin and would get called on each cron running. Now we can run Moodle's cron job each minute, and rather then hundred of tasks get called, just the scheduled ones due and adhoc tasks should run.
So if you look at your Moodle cron output and see lots of scheduled tasks and adhoc tasks logging actions there, all is good. Thats how it is supposed to be.