Created
December 22, 2019 21:44
-
-
Save lukapaunovic/3d97f647e474735543bdc6a48415f65e to your computer and use it in GitHub Desktop.
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 | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/vesta/bin | |
SHELL=/bin/bash | |
MULTILINE=$(ls \ | |
-1) | |
#Get latest WP-CLI | |
rm -rf /home/wp | |
wget --quiet https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /home/wp | |
chmod +x /home/wp | |
sleep 2 | |
PHP_PATH="/usr/bin/php" | |
# Start updating | |
echo -e "Updating WP core $Color_Off"; | |
sudo -H -ubmagazine /usr/bin/php /home/wp core update --skip-plugins --skip-themes --path='/home/bmagazine/web/bitcoinmagazine.nl/public_html' | |
echo -e "Updating plugins $Color_Off"; | |
sudo -H -ubmagazine /usr/bin/php /home/wp plugin update-all --skip-plugins --skip-themes --path='/home/bmagazine/web/bitcoinmagazine.nl/public_html' | |
echo Clearing REDIS Cache: $(/usr/bin/redis-cli flushall) | |
sudo -H -ubmagazine /usr/bin/php /home/wp total-cache pgcache_cleanup --skip-themes --path='/home/bmagazine/web/bitcoinmagazine.nl/public_html' | |
service nginx restart | |
service php-fpm restart | |
/usr/sbin/sendmail "[email protected]" <<EOF | |
subject:Daily WP Updates | |
from:[email protected] | |
$(cat /home/log.txt) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment