[server-admins] yum-update-and-wiki-update.sh

Jonathan Marsden jmarsden at fastmail.fm
Mon Jul 27 00:35:22 MST 2009


Jonathan Marsden wrote:

> 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

There was a one character typo in that one.  Corrected script is:


#!/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 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