[SOLVED] How to Enable or disable Maintenance Mode using Drush in Drupal9

Zyxware default image2

Steps for Enabling or disabling maintenance mode using Drush
1. Run the following Drush commands to enable maintenance mode and clear
 

drush state:set system.maintenance_mode 1
drush cr

2.Run the following Drush commands to disable maintenance mode and clear the cache:

drush state:set system.maintenance_mode 0 
drush cache:rebuild

After running either set of commands, verify that your site is either in or out of maintenance mode by visiting the site in a browser where you are not logged in.

References

https://www.drupal.org/docs/user_guide/en/extend-maintenance.html

https://drupal.stackexchange.com/questions/16/how-to-take-a-site-offline-using-drush