Last active
December 18, 2016 11:28
-
-
Save Rahe/685971baae79f233cc70584b8f808d19 to your computer and use it in GitHub Desktop.
Run all cron due cron events on multisite
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 | |
if [ -z "$1" ] | |
then | |
echo "You need to pass the url of the site. Usage ./cron-mu-cli.php http://mysite.fr" | |
exit | |
fi | |
for url in $( wp site list --field=url --url=$1 ) | |
do | |
wp cron event run --due-now --url=$url; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment