Multi-Site Update with Drush
If you are in need of a quick solution to update a multi-site code base via drush then I may have a solution for you. It's not the perfect solution but it should work just fine and has for me so far. Check it out!
So recently I can across a need to run updates to a multi-site installation of Drupal. Now normally for anything like this I use drush, but the one problem with drush is it doesn't have multi-site support built in. Well this particular installation had about 25 sites on it and I had zero desire to run a drush command 25 times, nor did I want to have to do that in the future when I needed to update again, so I took a few minutes and wrote the bash script below. I worked wonderfully and until I find something wrong with it or until drush releases multi-site support itwill become a integral part of my Drupal-CLI Fu.
[bash]
#!/bin/bash
for site in `ls sites`; do
if [ "$site" != "./" ]; then
echo $site
drush -l $site update -y
fi
done
[bash]
I've also provided the file as a downloadable attachment.
I'm assuming that if you know what drush is and how to use it you won't need instructions on how to use this but if you do just shoot me an @reply or an email and I'll be happy to help.
Search Site
Latest Posts
Get In Touch
Feel free to contact me about how I can help with your next Web project.
Telephone: 910-808-1717
E-mail: info@adamagregory.com


Add Your Comment