GithubHelp home page GithubHelp logo

mediawiki-backup-bash's Introduction

mediawiki-backup-bash

This is a set of bash scripts for regular backups of Mediawiki installations.

  • mediawiki_regular_install_backup.sh - creates files and database dumps of regular Mediawiki installation.
  • create_backup.sh - creates files and database dumps of Mediawiki farm installation powered by MinimalistFarm extension.
  • rotate_backup.sh - rotates backups folder keeping only recent ones.
  • s3upload.sh - synchronises specified directory to remote bucket on S3.

Each script is bundled with help messages so give it a try to get more information about parameters.

Requirements

  • Linux with bash
  • Mediawiki installation to backup
  • s3cmd (optionally, only for s3upload.sh)

Examples

$ ./mediawiki_regular_install_backup.sh

====================================================================================
 MWBACKUP is a bash script that helps you to create and rotate backups of Mediawiki site.
          It will create backup of files and database and place it into specified directory
          under a folder named after as a timestamp in yyyy-mm-dd format.
 Example usage:
  ./mwbackup.sh WIKI_ROOT BACKUP_DORECTORY [PATH_TO_LOCALSETTINGS]
      WIKI_ROOT               - absolute path to wiki root directory
      BACKUP_DORECTORY        - absolute path to folder where backups will be stored
      PATH_TO_LOCALSETTINGS   - (optional) path to directory with LocalSettings.php file
                                if stored in different from default location
====================================================================================
$ ./rotate_backup.sh

 The script rotates backups by deleting sub-folders of the specified folder.
 It uses output of ls command so it implies that sub-folders are named in yyyy-mm-dd format or similar.
 Example usage:
  ./rotate_backup.sh  BACKUP_FOLDER  KEEP_NUMBER
      BACKUP_FOLDER   - path to backups folder (like daily backups root or weekly backups root, etc)
      KEEP_NUMBER     - number of recent backups to keep
$ ./s3upload.sh 

====================================================================================
 The script syncronizes specified directory contents to S3 bucket.
 Note that it will not delete already uploaded to S3 files, only add new and update modified ones.
 Example usage:
  ./s3upload.sh DIRECTORY BUCKET
      DIRECTORY   - absolute path to the directory
      BUCKET      - name of the bucket to upload files
====================================================================================
$ ./create_backup.sh 

 The script backups wiki files and database. It is intended to work with MinimalistFarm enabled wikis only.
 Example usage:
  ./create_backup.sh  FARM_ROOT  EXT_PATH  BACKUP_FOLDER  TIME_TAG
      FARM_ROOT       - absolute path to farm wiki directory
      EXT_PATH        - relative (to farm root) path to directory of MinimalistFarm extension
      BACKUP_FOLDER   - path to store backups
      TIME_TAG        - mandatory frequency tag for a backup [daily|weekly|monthly]

Crontab examples

Scripts could be combined together to build a backup cycle, for example the following crontab list will create daily backups into ~/backups/ folder, rotate it keeping only last 7 days backups and synchronize it to S3:

# Daily backups
0 0 * * * sh ~/mediawiki_regular_install_backup.sh /var/www/mediawiki ~/backups > ~/backup.log
0 3 * * * sh ~/rotate_backup.sh ~/backups 7 > ~/backup_rotate.log
0 4 * * * sh ~/s3upload.sh ~/backups mybucket

mediawiki-backup-bash's People

Contributors

vedmaka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.