Why? Because i'm lazy. I'll update this to see if it works

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#!/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

comments powered by Disqus