Skip to content

Instantly share code, notes, and snippets.

@ajdinmore
Created February 25, 2019 16:20
Show Gist options
  • Save ajdinmore/86ff965f2116fbb1454715494ca1613b to your computer and use it in GitHub Desktop.
Save ajdinmore/86ff965f2116fbb1454715494ca1613b to your computer and use it in GitHub Desktop.
WordPress Multisite Cron Shell Script
#!/bin/bash
WP_PATH="/srv/example/public_html"
for SITE_URL in $(wp site list --field=url --archived=0 --deleted=0 --path="$WP_PATH")
do
echo -e "\n$SITE_URL"
wp cron event run --due-now --path="$WP_PATH" --url="$SITE_URL"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment