Some quick one-liners that can come in handy when using drush
, Drupal’s command line interface.
Place all websites in Drupal maintenance mode
$ drush @sites vset site_offline 1
Place a specific multi-site website in maintenance mode
$ drush -l site_alias_name vset site_offline 1
Take all sites out of maintenance mode
$ drush @sites vset site_offline 0
Set the cache lifetime for all sites to 1800 seconds
$ drush @sites vset cache_lifetime 600 $ drush @sites vset page_cache_maximum_age 1800
List all sites in a multi-site drupal setup
$ drush @sites status You are about to execute 'status' non-interactively (--yes forced) on all of the following targets: /var/www/html/site#multisite_A /var/www/html/site#multisite_B Continue? (y/n): ...
Flush all caches (varnish, memcached, …)
$ drush @sites cc all
Disable drupal’s cron
$ drush @sites vset cron_safe_threshold 0
If you know any more life-saving drush commands (you know the kind, the ones you need when all hell breaks loose and everything’s offline), let me know!