Johannes Thönes

Software-Developer, ThoughtWorker, Permanent Journeyman, Ruby Enthusiast, Java and Devils Advocate.

A Ruby Script for Upgrading Multiple DokuWiki Installations

| Comments

After DokuWiki has been released multiple times in the last few days because of security problems, I though it was a good time, to write a little script for automatically updating multiple instances. You can find the ruby script at http://gist.github.com/285219.

The ruby script basically automates the upgrade instructions from the DokuWiki main page. So the following actions are performed when executing the script:

  1. Making a backup into /tmp/dokuwiki_backup_#{timestamp} of every installation.

  2. Downloading the dokuwiki release (passed in as a parameter).

  3. Extracting the files and copying everything to the installations (execept for the content of the /data directory).

  4. Creating missing folders in the /data directory, making the owner www-data:www-data and chmodding them to 664.

  5. Deleting files from a list of file from older revisions.

Within the script you need to specifiy this snipped for setting your DokuWiki installations:

1
2
3
4
5
# Definition of existing installation
INSTALLATIONS = [
  '/path/to/docu/wiki/installation1',
  '/path/to/docu/wiki/installation2'
].freeze

Then you can call for a new release as follows:

1
/path/to/script/upgrade_dokuwiki.rb http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2009-12-25c.tgz

If you want to improve the script, feel free to fork me on Gist.

Comments