Created
January 10, 2019 09:01
-
-
Save Biont/aa9c18115fd3559641e7d314a4480c43 to your computer and use it in GitHub Desktop.
Run WP-CLI command for all sites in the network. Uses 16 threads for parallel execution
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
#!/usr/bin/env bash | |
# Usage: multisite.sh plugin list | |
N=16 | |
i=0 | |
for URL in $(wp site list --field=url); do | |
((i=i%N)); ((i++==0)) && wait | |
wp "$@" --url="$URL" & | |
done | |
wait | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment