[server-admins] yum-update-and-wiki-update.sh
Jonathan Marsden
jmarsden at fastmail.fm
Mon Jul 27 00:24:50 MST 2009
Here is the wrapper script that backs up the wiki, runs yum update,
and then runs the update.php script.
This is untested, because I don't have privs to run it. It assumes
backup-wiki.sh is somewhere in $PATH
This script is at /home/jmarsden/yum-update-and-wiki-update.sh on
www.crosswire.org .
Jonathan
#!/bin/bash
# yum-update-and-wiki-update.sh
# Backs up the mediawiki and then runs yum update and updates wiki.
# Optional parameter is backup directory.
#
# Author: Jonathan Marsden <jmarsden at fastmail.fm>
# Date: 2009-07-26
#
# Global config variables
DEFAULTBACKUPDIR="/usr/local/backup/mediawiki" # Default backup location
BACKUPDIR=${1:"$DEFAULTBACKUPDIR"}
WIKIDIR="/usr/share/mediawiki"
WIKIUPDATER="maintenance/update.php"
# Back up the wiki
backup-wiki.sh "$BACKUPDIR"
# Run yum update
sudo yum update -y
# Run the PHP script to update the wiki database
cd "$WIKIDIR" && php $WIKIUPDATER
More information about the server-admins
mailing list