“Truth, like light, blinds. Falsehood, on the contrary, is a beautiful twilight that enhances every object.”


My Wordpress Upgrade Bash Script

I’m not a UNIX guru, so I can’t really memorize all commands. When upgrading my Wordpress version, I only run four lines of commands, but I can’t remember the parameters. Today, I was in the mood to write a simple bash shell script so that next time all I have to do to upgrade my site are: backup, run the script, relax… The script does not backup data and design files. If you are to use the code, make sure to backup before running the script. Check out Wordpress for backup solutions.


#!/bin/bash

#
# Wordpress Upgrade Script
# Author: Alfonso Varon
#
# PRECONDITION: Data & design backup should have been done.
#

echo "Warning!!! Backup design files and data before proceeding..."
echo -e "\n"
echo -e "Let's begin...\n"
echo -n "Which site would you like to update ([1]=arot, [2]=sol): ”
read -e SITE
setterm -background $SITE

if [ $SITE -eq 1 ] # upgrade ARoT
then
 echo “Changing to A Record of Thoughts directory…”
 cd ~/public_html
elif [ $SITE -eq 2 ] # upgrade SoL
then echo “Changing to Sapian Online’s directory…”
 cd ~/public_html/xxx
fi

echo -e “We are currently in directory:”
pwd

echo -e “\n”
echo -e “Downloading the latest version of Wordpress…”
wget http://wordpress.org/latest.tar.gz
echo -e “Done.”
echo -e “Unzipping the package…”
tar -xzvf latest.tar.gz
echo -e “Done.”
echo -e “Upgrading…”
cp -rpf –reply=yes wordpress/* ./
echo -e “Done.”
echo -e “Cleaning…”
rm -rf ./wordpress
rm latest.tar.gz
echo -e “Done.\n”
echo -e “Wordpress files have been upgraded. Go to the administration
panel for further upgrade instructions.”

Add comment April 5th, 2008

WordPress 2.5

WP2.5 is coming out soon (already late). My theme is still the primitive version. It doesn’t even support widgets yet. I’ve done so much modifications in this theme and I stupidly forgot to keep tabs of the changes. Now I’m contemplating whether to upgrade the theme as I upgrade WP. Should I?

EDITION: I decided to create a test site and start fiddling with the new’r version.

Add comment March 10th, 2008

Safari

I’ve known for a while that Apple is working on a Windows version of Safari. Finally, I found a time to install; it’s on Beta. It is pretty cool. I feel like I’m on a Mac. I guess I don’t have to fantasize about having a Mac since Apple is expanding towards Windows compatibility. Safari is the last application I wanted from Apple since the release of iTunes for Windows. I’m satisfied.

1 comment July 15th, 2007


Calendar

July 2008
M T W T F S S
« Jun    
 123456
78910111213
14151617181920
21222324252627
28293031  

Posts by Month

Posts by Category

Advertisement

Currently Reading

Fundamental Principles of the Metaphysics of Morals (Philosophical Classics) The Fountainhead