Difference between revisions of "Off-site Backup with Backupninja"

From Run Your Own
Jump to: navigation, search
(On the Off-site machine)
Line 5: Line 5:
 
* A configure Linux/BSD machine to work as off-site backup
 
* A configure Linux/BSD machine to work as off-site backup
 
* A <code>lurk</code> user created on the off-site backup that will be used specifically by the backup scripts
 
* A <code>lurk</code> user created on the off-site backup that will be used specifically by the backup scripts
 +
* Debian based servers (not sure Backupninja will run otherwise without some slight modifications)
 
* All the machines (servers and the backup machine) on a working Tinc VPN
 
* All the machines (servers and the backup machine) on a working Tinc VPN
 
* Enough space on the off-site backup machine :)
 
* Enough space on the off-site backup machine :)
Line 11: Line 12:
 
* As <code>lurk</code> create directories for each server
 
* As <code>lurk</code> create directories for each server
 
  mkdir /media/lurk_backup/douglas /media/lurk_backup/agnesbaxter
 
  mkdir /media/lurk_backup/douglas /media/lurk_backup/agnesbaxter
 +
 +
== On each server ==
 +
=== Installation ===
 +
* As <code>root</code>
 +
apt install backupninja
 +
 +
=== Configuration ===
 +
==== /etc/backupninja.conf ====
 +
Some changes:
 +
reportemail = some@where.nice
 +
when = everyday at 05:55
 +
 +
=== MySQL ===
 +
* Run the command:
 +
sudo ninjahelper
 +
* create a new backup action
 +
* mysql database backup
 +
* path:
 +
/var/backups/mysql
 +
* all the databases to backup.
 +
* select the debian maintenance user for access
 +
* compress the sql output file
 +
* optional: select the action and test/run/review the config
 +
* leave ninjahelper

Revision as of 12:15, 25 August 2018

Goal: Setup a remote machine that will be used for incremental backup of critical parts of the LURK servers.

Requirements

This document assumes you already have:

  • A configure Linux/BSD machine to work as off-site backup
  • A lurk user created on the off-site backup that will be used specifically by the backup scripts
  • Debian based servers (not sure Backupninja will run otherwise without some slight modifications)
  • All the machines (servers and the backup machine) on a working Tinc VPN
  • Enough space on the off-site backup machine :)

On the Off-site machine

  • As lurk create directories for each server
mkdir /media/lurk_backup/douglas /media/lurk_backup/agnesbaxter

On each server

Installation

  • As root
apt install backupninja

Configuration

/etc/backupninja.conf

Some changes:

reportemail = some@where.nice
when = everyday at 05:55

MySQL

  • Run the command:
sudo ninjahelper
  • create a new backup action
  • mysql database backup
  • path:
/var/backups/mysql
  • all the databases to backup.
  • select the debian maintenance user for access
  • compress the sql output file
  • optional: select the action and test/run/review the config
  • leave ninjahelper