Created
April 16, 2018 07:38
-
-
Save faishal/41e4ba29dab6b4f1f26076e09e5fc254 to your computer and use it in GitHub Desktop.
ElasticPress index all sites in network
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/bash | |
for SITE_URL in $(wp site list --fields=domain,path,archived,deleted --format=csv --url=cmsdev.sc.com | grep ",0,0$" | awk -F ',' '{print $1 $2}') | |
do | |
echo "Indexing $SITE_URL ..." | |
echo "--- BEGIN INDEXING $SITE_URL ---" &>> indexing.log | |
wp elasticpress index --setup --url="$SITE_URL" --show-bulk-errors &>> indexing.log | |
echo "--- END INDEXING $SITE_URL ---" &>> indexing.log | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment