should i disable the cron job while upgrading my site?

should i disable the cron job while upgrading my site?

by Corey Brett -
Number of replies: 4
Should I disable my cron job (that runs once per min) while I am upgrading the site?
Average of ratings: -
In reply to Corey Brett

Re: should i disable the cron job while upgrading my site?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hmm, I never have and never have had any issues.

In reply to Corey Brett

Re: should i disable the cron job while upgrading my site?

by Ken Task -
Picture of Particularly helpful Moodlers

I do command line updates and upgrades.  In my  little bash shell script I first had the script set the maintenance mode to on, then tried to run cron.   Didn't work.   Cron would not run, reporting site as being in maint mode (being updated or upgraded).  

Assuming the GUI update/upgrades work the same way ... if you set your site to maintenance mode first before doing update or upgrade, cron will not run.  It detects maintenance mode and will not run until site is out of the maintenance modle.

'spirit of sharing', Kn


In reply to Ken Task

Re: should i disable the cron job while upgrading my site?

by Corey Brett -

Awesome, thanks.

I wonder if I enabled maintenance mode while cron was already running, if that would cause any issues.

Probably not, just curious. smile

In reply to Corey Brett

Re: should i disable the cron job while upgrading my site?

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, to be curious ... probably should be encouraged to ask questions that consider the flip of anything! smile

Don't think enabling the maintenance mode would issue a kill -9 command to any process/scheduled task that was already running - just wouldn't launch the next in the schedule.   But don't know that for certain, never watched processes/task list execution once maintenance mode enabled.  Take a look at your task list in Moodle Admin UI and you can see that many are set to run ASAP but they are for every 50 minutes or so.

Just one thing that might mess up ... depending ... scheduled automated backups.   Those one would hopefully set for non-prime time (ie, midnight til 2or3 AM) I would think.   What would it mess up kinda depends on how many courses, overall length of time to run through backups of those courses etc..   So the entire process on a large site might not actually finish when server not being hit by users.

If one does CLI updates and upgrades, those usually take well under 5 minutes with git.

'spirit of sharing', Ken