What’s with these multiple posts in a day…
Today marks the completion of my Multiple WordPress Updater Script. I’ve already posted a bunch about school stuff, might as well post about work stuff too.
We host over 55 blogs at CHNM. It’s up to me to update them when security patches or new versions come out. Doing them each by hand is a pain. I did a bit of searching but didn’t find anything that would help me update so many sites automatically. So I wrote a bash script that will do it for me. It reads a file that lists all of the wordpress install paths or prompts you for the path to one, prompts for the version to switch to, and a mysql user/pass that has permissions for all databases.
Then the script creates a copy of the database, makes a copy of the wp-content folder, updates the wordpress install using subversion, fixes some permissions, and saves the subversion output to a file in your home directory (which I’ll probably change to somewhere’s else).
I run this via sudo as root for easy updating. What I’m really pleased with is that I figured out how to get the script to pull the database name from the wp-config.php file, and grab the owner and group for later fixing of the permissions.
I hope it can be useful to someone. If you have any comments or suggestions, let me know.
Latest Version: 1.2.3 – 04/29/08
UPDATE 24.4.08: WordPress Updater has been updated. I also updated this post, took out the code in the post, and put up a link to the file for you to download instead.