SurlyJake Blog

Script to Update Wordpress

| Comments

Why? Because i’m lazy. I’ll update this to see if it works `#!/bin/sh

your current site will be backed up to your home folder with the date in the name

change this to whatever you want

BACKUPNAME=“wordpress_site_b4_update” BACKUPDATE=date +%y%m%d

this is the path to your wordpress site’s root

SITEROOT=“/usr/local/www/”

here she goez…

cd ~ tar -pczf “$BACKUPNAME”“$BACKUPDATE”.tar.gz “$SITEROOT” cd /usr/local fetch http://wordpress.org/latest.tar.gz tar -xzf latest.tar.gz rm latest.tar.gz cp -R wordpress/* “$SITEROOT”/ rm -R wordpress chown -R www “$SITEROOT” `

Comments