Skip to content

Instantly share code, notes, and snippets.

@xezpeleta
Last active April 29, 2016 11:07
Show Gist options
  • Save xezpeleta/c2398ff374e2e4372a69 to your computer and use it in GitHub Desktop.
Save xezpeleta/c2398ff374e2e4372a69 to your computer and use it in GitHub Desktop.
Keep your WordPress installations updated
#! /bin/sh
##
# update-wordpress.sh It will update your WordPress installation using the utility wp-cli http://wp-cli.org
# To keep your WP updated, you can copy this script into your /etc/cron.daily directory
# Don't forget to add execution right and remove ".sh" extension from the filename.
##
WPDIR=/var/www/myblog
sudo -u www-data -s -- <<EOF
echo "Updating myblog.mydomain.eus WordPress..."
wp --path=$WPDIR core update
wp --path=$WPDIR plugin update --all
wp --path=$WPDIR theme update --all
wp --path=$WPDIR core language update
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment