Skip to content

Instantly share code, notes, and snippets.

@ouun
Last active October 19, 2020 15:10
Show Gist options
  • Save ouun/6e00338712257f8ecb5bb54753ab79ca to your computer and use it in GitHub Desktop.
Save ouun/6e00338712257f8ecb5bb54753ab79ca to your computer and use it in GitHub Desktop.
#!/bin/bash
clear
PATH_TO_WORDPRESS="/var/www/public_html"
for URL in = $(wp site list --field=url --deleted=0 --archived=0 --path="$PATH_TO_WORDPRESS")
do
if [[ $URL == "http"* ]]; then
wp cron event run --all --due-now --url="$URL" --path="$PATH_TO_WORDPRESS"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment