2/6/2018 - 5:58 PM

A simple bash script to update Wordpress


# This work is licenced under the Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License. 
# To view a copy of this licence, visit or send a letter 
# to Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.

# So before you start, the script assumes the following:
# 1. you have some sort of SSH access
# 2. you are owner of your blog (in terms of computa permissions)
# 3. the blog folder is called 'blog' (if not, change all instances of the word 'blog' with whatever it's called)
# 4. the server has curl installed
# 5. the server has un/zip installed (if not, change the zip to use gnutar)
# 6. and that the only changes you've ever made to your wordpress blog are /wp-config.php and in /wp-content folder
# Also, if it goes tits up, I don't accept any responsibility, so use are your own risk!

cd ~/www/
rm -rf blog-orig
cp -R blog blog-orig
curl -O
rm -rf wordpress/wp-content
cp -R blog/wp-con* wordpress
rm -rf blog
mv wordpress blog
rm -rf
echo 'Done! If everything has gone to plan, please delete the blog-orig folder in your blog directory.'