Maintenance mode from the command line

Maintenance mode from the command line

by Lindsay Magnus -
Number of replies: 3
Is it possible to set the site into Maintenance mode from the linux command line?
Average of ratings: -
In reply to Lindsay Magnus

Re: Maintenance mode from the command line

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I think the question itself is some sort of "command line magic" - quick, short and sweet ;)
In reply to Lindsay Magnus

Re: Maintenance mode from the command line

by Shane Elliott -
Picture of Core developers Picture of Plugin developers
You can put the site into maintenance mode by creating the following file:
moodle_data_directory/SITEID/maintenance.html
where SITEID is the id of the site 'course' - usually '1'

The content of maintenance.html is the message displayed to non-admin users when they try to access the site. If you just want the standard message displayed then something like "touch moodle_data_directory/SITEID/maintenance.html" should do the trick.
In reply to Shane Elliott

Re: Maintenance mode from the command line

by Martín Langhoff -
Yup! That's the way wink

We've got this as part of our automated upgrade scripts...