Wikimedia sync script

Jump to navigation Jump to search

It is possible to keep your MediaWiki install automatically synced with the Wikimedia wikis by way of a script. This can be a good idea because your wikis are automatically up to date and you will have the same functionality as the Wikimedia wikis (without the terror of absolute bleeding edge).

  1. Save the script below as
  2. chmod +x
  3. Add a job to your crontab for it to run as often as you want (once a day should be fine):
    0 3 * * * /path/to/

It's probably a good idea to add a script that creates backups on a regular basis as well…


By Andrew Garrett, under a "do whatever you want with it" license:

#!/usr/bin/perl -w

use LWP::Simple;

my $text = get '';

if ($text =~ /\[rev\] \=\> (\d+)/) {
    $rev = $1;
} else {
    die "Can't get Wikimedia's SVN revision";

print "Updating to r$rev\n";

`svn up /path/to/base/of/mediawiki/install/ -r $rev`;
`php /path/to/base/of/mediawiki/install/maintenance/update.php`;