wiki_backup

  • Project Name: wiki_backup
  • Source: http://spiderfell.dyndns.org/svn/wiki/wiki_backup
  • Language: perl
  • Platform: Linux
  • Number of Files: 1
  • Summary: The wiki_backup script is used to backup and restore data in a mediawiki installation.  It will make a hot copy of the database itself, as well as a SQL dump file of the database, and all the images uploaded to the wiki.  This script assumes that it will be run no more than once per day.

Basic Usage

 wiki_backup -[b|r] -c config -B basedir -K backupdir -P passwd wikinamelist
  • -b – the backup flag, use this if you are going to be backing up a wiki.
  • -r – the restore flag, use this if you are going to be restoring a wiki.
  • -c – Use this flag to specify a config file to use.  A config file can be used in place of or in conjuction with the rest of the flags.
  • -B – This indicates the base directory of the wikis you are going to back up or restore.  If you are only affecting one wiki, ensure that this is still set to the directory containing the wiki directory.
  • -K – This is the directory that contains or will contain the backups.
  • -P – This is the passwd of the mysql account associated with the wikis.
  • wikinamelist – A list of wikis (based on directory names) to be backed up/restored.

Of these arguments, either -b or -r, -B, -K, and wikinamelist are required for the script to function.  If the wikidb user account has an associated password then -P will be required.  Some of these may be neglected if the -c argument is given and those values are specified in the config file.

Config File

The config file may be used in conjunction with any of the command-line arguments, or by itself.  The config file offers two other features that are not accessible from the command-line: the backup limit and the archive frequency.

  • basedir: the directory where all your wiki’s are kept, be sure this is a full path.  This MUST be included or else the script will abort.
    • Example: basedir = /var/www
  • backupdir: the directory to which you wish to store your backups, be sure to use a full path.  If this isn’t included it is assumed that the current directory is where the backup should end up.
    • Example: backupdir = /local/ad/wiki_backups
  • passwd: the root passwd for mysql in order to make database backups.  If this isn’t included it is assumed that there is no root password.
    • Example: passwd = supersecretpassword
  • wikilist: a comma seperated list of the directory names of all all your wikis.  These should be directory names only, not paths.  This MUST be included else the script will abort.
    • Example: wikilist = wiki,otherwiki,wiki2
  • backup_limit: the limit of backups you wish to keep from your routine backups.  The older files that surpass this limit will be deleted.  NOTE: this does not count the archived copies. Archived backups must be deleted manually.
    • Example: backup_limit = 5
  • arch_freq: the frequency at which you want the script to create an archive separate from the usual backup.  For instance, creating a monthly archive where you normally backup daily.  Usable values are: DAILY, WEEKLY, and MONTHLY
    • Example: arch_freq = MONTHLY

Comments are closed.