[ubuntu-uk] Distributed Backup Proposal

Alan Lord (News) alanslists at gmail.com
Sat Jul 24 12:21:33 BST 2010


On 24/07/10 08:40, Dan Fish wrote:
> Hi
>
> This is a call for help for a project that I've set up after a
> discussion on IRC. The general idea is this - we all have data we'd
> rather like to have backed up off-site, and a number of options exist -
> dropbox, amazon s3 etc. However, most of us have some storage to spare,
> so how about creating a peer to peer, multiple redundancy, off-site
> backup system?

Hmmm, Hi Dan,

I have a simple bash script that gets called every night at various 
intervals as a cron job on my little home server. What it does is backup 
stuff from every machine in our house that I want backed up to one or 
more of the other machines in our house. So I always have a backup on a 
different computer.

It use WOL to turn them all on, ssh (key auth so no passwords) and rsync 
for the for the actual backup. Although I plan to test it with, and 
maybe move to, rdiff-backup or rsnapshot.

The script takes "machine information" files as parameters so for example:

$ gh_backup.sh vimes twoflower

Would backup vimes to twoflower.

$ gh_backup.sh binky vimes

would backup binky to vimes.

$ gh_backup lobsang

would backup lobsang to localhost (the machine running the script).

The directories to be backed up and all other necessary information is 
stored in individual machine files in etc/gh_backup.d/machine_name. 
Example at the end of this mail.

This seems to work quite well for me and the Lordy clan.

I'm not sure I would be particularly keen on having my backup data 
stored on some random computer somewhere that I do not have any control 
over, but the basic idea above might be food for thought...

Al


Example:
-------------------------------------------------------------------
#!/bin/bash

# Backup script host configuration file. Contains all data necessary
# for a single machine. Filename MUST be the hostname of machine.

# Mac address of the interface if it needs to be "woken up". Obviously
# machine must support WOL (Wake-on-Lan) and have been configured
# (ususally a BIOS setting)
MAC="AA:BB:CC:DD:EE:FF"

# Machine's IP address or domain name, e.g mypc.home.net
ADDR="127.0.0.1"

# User of this machine with admin rights. For systems with sudo
# Add the following line to /etc/sudoers so we don't need a password
# %admin ALL=NOPASSWD: /sbin/halt. Assumes $USER is in the admin group!
UNAME="username"

# Directories you want backed up space delimited between the quotes
SRC="/home/fred /var/www /etc"

# If you want to exclude particular files or directories enter them here
# Once again space delimited between the quotes. There are some default
# default excludes already set in the script. These are:
# --exclude=.trash/ (Trash directory)
# --exclude=.local/share/Trash (Trash Directory)
# --exclude=*~ (Temporary files)
# PLease add any specific exclusions in the format below.
EXCL="--exclude=tmp/"

# If this machine will also host backed up data enter the FULL path
# here. Only one path is currently supported.
DEST="/home/backups"
---------------------------------------------------------

-- 
The Open Learning Centre
http://www.theopenlearningcentre.com




More information about the ubuntu-uk mailing list