Skip to content

Instantly share code, notes, and snippets.

@lukapaunovic
Created December 22, 2019 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukapaunovic/3d97f647e474735543bdc6a48415f65e to your computer and use it in GitHub Desktop.
Save lukapaunovic/3d97f647e474735543bdc6a48415f65e to your computer and use it in GitHub Desktop.
#!/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 "wessel@responsivemedia.nl" <<EOF
subject:Daily WP Updates
from:root@server.bitcoinmagazine.nl
$(cat /home/log.txt)
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment