wiki:faq/backup-setup

Version 2 (modified by Jamie McClelland, 13 years ago) (diff)

--

If you are running a linux backup system and you'd like an offsite server to back your data up to, you can use the May First/People Link shared backup server. If you are using an OS X server, you will not be able to use these directions. You will be able to do backups using rsync (with: rsync+hfsmode), however, rdiff-backup uses the rsync libraries, it does not call rsync directly. So getting the proper HFS file system support will require using rsync+hfsmode directly). If you are using Windows, we'd strongly encourage you to setup a linux file server prior to trying any type of automated backup system.

Having said that...You are free to use whatever backup software you like, provided that it can copy files via ssh using an ssh public/private key pair.

We recommend that you use backupninja and rdiff-backup. Below are instructions for how to get started with these two programs.

NOTE: in it's current release backupninja has no internal way to limit bandwidth (bandwidth limiting will be available in future releases). Therefore you should run it through trickle. dkg explains it with:

Say you want to limit backupninja 50Kbps down and 70Kbps up. Instead of running

backupninja -n

you can run

trickle -d 50 -u 70 backupninja -n

If you are not running Debian, please check out the respective web sites for backupninja and rdiff-backup to download the programs (http://dev.riseup.net/backupninja and http://www.nongnu.org/rdiff-backup).

The directions below assume that you are running Debian linux.

  • Create an ssh key pair as the root user on your server (if you haven't already):
ssh-keygen -t rsa
  • Email the public key to support@…. The public key should be stored in /root/.ssh/id_rsa.pub
  • Test the public key (after you've received confirmation that it has been installed) by trying to ssh into our backup server while you are root:
ssh MEMBERNAME-sync@c.backup.mayfirst.org
  • Install backupninja and rdiff-backup

NOTE: You'll need to install the same version of rdiff-backup that we have on our server. Our version runs the version of rdiff-backup in Debian Etch. If you are running Sarge, you'll want to install rdiff-backup from backports.org. As of April 10, 2007 we are using rdiff-backup version 1.1.5.

apt-get install backupninja rdiff-backup
  • Create a file in /etc/backup.d called 90-mfpl.rdiff with contents along the lines of:
#options = --force

######################################################
## source section
## (where the files to be backed up are coming from)

[source]


# an optional subdirectory below 'directory' (see [dest])
label = SERVERNAME

# only local type is currently supported
type = local

# how many days of data to keep
keep = 5

# files to include in the backup
# (supports globbing with '*')
include = /etc
include = /var/log
include = /var/www
include = /home

# files to exclude from the backup
# (supports globbing with '*')
exclude = /etc/dnscache/*

######################################################
## destination section
## (where the files are copied to)

[dest]

# only remote type is currently supported
type = remote

# the machine which will receive the backups
host = c.backup.mayfirst.org

# put the backups under this directory
directory = /home/members/MEMBERNAME/backups/

# make the files owned by this user
# note: you must be able to ssh backupuser@backhost
# without specifying a password
user = MEMBERNAME-sync
  • Edit /etc/backupninja.conf

Ask May First/People link what time you should schedule your backup and edit the when line appropriately.

  • Test with:
backupninja -t -n -d

(t is test, n is now, d is debug)

A few additional thoughts from abh:

If you're getting funky errors, definitely ask for help here, but try making sure you're backing up to the right directory. I wasn't!

And - hints for setting up a nullmailer to handle emailing: here.