Clean up Moodle cron jobs

Clean up Moodle cron jobs

by Roberto Arrial -
Number of replies: 3

Hi all,

We have a Moodle 2.5.1 (LAMP structure) running for some months now. We have never run admin/cron.php and not set the task for the cron.

Question is, if we run cron.php today, tasks which were scheduled (and never executed) will be triggered and we will get lots of email, and other processes?

If this is the case, can we get rid of old cron jobs so we may start a fresh new cron?

Thanks!

Average of ratings: -
In reply to Roberto Arrial

Re: Clean up Moodle cron jobs

by Dan Bennett -

Add 

$CFG->noemailever = true;

to your config.php and save it.

Run the cron.php script. It'll do everything but it won't send any emails out.

Then, when done, take it out or slash it out (// at the beginning) then save it again.

I'd also advise that from this point you set up a crontab to run the cron every 15 or so minutes. See http://docs.moodle.org/25/en/Cron

smile

Average of ratings: Useful (1)
In reply to Dan Bennett

Re: Clean up Moodle cron jobs

by Roberto Arrial -

Thanks a lot! This is what I was looking for.

Other than email deluge, should I have other concerns about substantial site changes after running a "restrained" Cron, say, content alterations of any kind?

In reply to Roberto Arrial

Re: Clean up Moodle cron jobs

by Luis de Vasconcelos -

No, it won't be a problem. Cron is supposed to run at regular intervals.

But, depending on how long your Moodle site has been in use without a regular cron job running, the cron task might take a long time to finish the first time you run it. Run it the first time over a weekend and you should be ok.