Created
June 9, 2015 19:34
-
-
Save benclark/70a802c015ce74d610e3 to your computer and use it in GitHub Desktop.
Run drush updb in parallel in groups of 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Run `drush updb` in parallel in groups of 5. | |
# | |
# The for loop is populated by running `drush sa`, but this could also be a | |
# file with aliases on each line. | |
# | |
# The | |
i=0 | |
for site in $(drush sa); do | |
echo "---- $site" | |
nohup drush @$site updb -y < /dev/null > $HOME/drush-updb.$site.log 2>&1 & | |
i=$((i+1)) | |
if [ 0 -eq $((i%5)) ]; then | |
wait | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment