Created
September 11, 2018 19:40
-
-
Save ksaylor11/55395e6e3b9c0f89e4753533d7fb4c14 to your computer and use it in GitHub Desktop.
wordpress cron script
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
#/bin/bash | |
# adding some sense of time | |
start_time=`date +%s` | |
# use wp-cli to generate list of site urls | |
/usr/local/bin/wp site list --field=url --path=/var/www > sites.log; | |
url="wp-cron.php"; | |
# read from our file and act on each line | |
while read p; | |
do | |
# uncomment line below for debugging | |
# echo "$p$url"; | |
# need to add --delete-after in order to remove downloaded files | |
wget --no-cache --delete-after -q $p$url; | |
done < sites.log; | |
# let them know how long | |
echo run time is $(expr `date +%s` - $start_time) s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment