Last active
November 16, 2017 21:13
-
-
Save sorki/a6a28701c65cad4362e8cf43ded6fe45 to your computer and use it in GitHub Desktop.
wordpress check / update with wp-cli
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
# for crontab. e.g.: | |
# 5 5 * * * /root/bin/wp_check_update | |
BLOG_DIR=/var/www/<INSERT_BLOG_PATH> | |
wp --path=$BLOG_DIR core check-update --quiet | |
if [ "$?" != "0" ]; then | |
Wordpress update required | |
wp --path=$BLOG_DIR core check-update | |
fi |
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
BLOG_DIR=/var/www/<INSERT_BLOG_PATH> | |
wp --path=$BLOG_DIR core update | |
wp --path=$BLOG_DIR plugin update --all |
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
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
mv wp-cli.phar ~/bin/wp | |
chmod +x ~/bin/wp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment