If you are running a devOps system, you can put your sites in maintenance mode like this, from Drupal 8 and onward:

drush sset system.maintenance_mode 1
drush cr

Important to not forget clearing cache afterward!

 

 

Saved you some valuable time?

Received 100 so far from 4 kind contributors.