Quick & Dirty WordPress Upgrade

by dt on April 6th, 2011

You need to upgrade WordPress each time a new version is released (at least for security reason). Below is a shell script I use to upgrade WP from console. Pay attention to rm -rf lines!

cd wordpress
export WPUSER=`ls -l . | awk {'print $3'} | tail -1`
echo $WPUSER
rm -f latest
wget wordpress.org/latest
rm -rf wordpress
tar xzf latest
rm -f latest
chown -R $WPUSER:$WPUSER wordpress
/bin/cp -aR wordpress/* .
rm -rf wordpress
export WPUSER=''

shorturl: