A Ruby Script for Upgrading Multiple DokuWiki Installations
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:
- Making a backup into /tmp/dokuwiki_backup_#{timestamp} of every installation.
- Downloading the dokuwiki release (passed in as a parameter).
- Extracting the files and copying everything to the installations (execept for the content of the /data directory).
- Creating missing folders in the /data directory, making the owner www-data:www-data and chmodding them to 664.
- Deleting files from a list of file from older revisions.
Within the script you need to specifiy this snipped for setting your DokuWiki installations:
# 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:
/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.
Aaron:
Nice to read a new post in your blog!
24 Januar 2010, 9:29 pmBatch upgrading of installations is a crucial thing. Another strategy is to use a central “core installation” and link it in the actual install directory. So you need to update only one directory, the actual install directory contains only styles, config settings and uploaded files. The MoinMoin Wiki or Trac does is this way.