Last active
August 29, 2015 14:19
-
-
Save randomweapon/de5106da1095d5d3dbf5 to your computer and use it in GitHub Desktop.
WP-CLI cron bash script for Wordpress
This file contains hidden or 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 EVENT_HOOK in $(cd /location/wordpress/ && /usr/local/bin/wp cron event list --format=csv --fields=hook,next_run_relative | grep now | awk -F ',' '{print $1}') | |
do | |
/usr/local/bin/wp cron event run $EVENT_HOOK | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment