Skip to content

Instantly share code, notes, and snippets.

@Rahe
Last active December 18, 2016 11:28
Show Gist options
  • Save Rahe/685971baae79f233cc70584b8f808d19 to your computer and use it in GitHub Desktop.
Save Rahe/685971baae79f233cc70584b8f808d19 to your computer and use it in GitHub Desktop.
Run all cron due cron events on multisite
#!/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