BoxBackup for SME


Author : Dave Dumolo
Sources : Based on the documentation provided with BoxBackup
Tested on SME Version 6.0.1-01 GPL
Updated : 06 April 2005
License : GPL - but read the pages at http://www.fluffy.co.uk/boxbackup


Howto description


1) First action...

In a nutshell, this product consists of two parts - a backup server and a backup client. The backup server just sits there waiting to be told what to backup, and the client works on the machine where files need to be backed up sending the backup server the files to archive. The whole system works continuously and on an incremental basis so that files marked for backup gradually get pushed across to the backup archive on the backup server and everything is kept up-to-date automatically.

More information on this very useful product can be found on http://www.fluffy.co.uk/boxbackup.

I have implemented this system on my test rig using the following. You'll have to experiment to see just how much in the way of development RPMs you need. Alternatively, I could upload the compiled versions to somewhere on contribs if someone would be kind enough to donate some space.

Setup as follows:

The 'Site Production Server' requiring backups - SME 5.6 called Earth The SME server whose job it is is to hold backups - SME 6.0.1-01 with development RPMs called Mars

We'll do the majority of the work on Mars. It is assumed that there is an easy way for files to be transferred between running SME servers - i.e. between Earth and Mars in either direction. Exactly how you do this is up to you - I did it by using a Windoze box that could see both SME servers. I simply copied files that needed to be transferred between SME boxes into areas visible by Windoze and then used the power (?) of Windoze to move the files (Yes, you're right, it's called being lazy!).

So, this is how I did it (version II - improved on V1 by using latest OpenSSL) .......

Log into Mars as root.

mkdir -p /downloads/boxbackup
cd /downloads/boxbackup/
wget -c http://kent.dl.sourceforge.net/sourceforge/boxbackup/boxbackup-0.09.tgz
wget -c http://www.openssl.org/source/openssl-0.9.7f.tar.gz
#
mkdir -p /downloads/dev-rpms
cd /downloads/dev-rpms
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/anaconda-7.3-7es115.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/anaconda-runtime-7.3-7es115.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/apache-devel-1.3.27-2.7.2.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/autoconf-2.13-17.noarch.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/automake-1.4p5-4.noarch.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/bison-1.35-1.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/cpp-2.96-113.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/gcc-2.96-113.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/gcc-c++-2.96-113.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/gettext-0.11.1-2.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/glibc-devel-2.2.5-44.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/glibc-kernheaders-2.4-7.16.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/kernel-source-2.4.20-18.7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libacl-2.0.11-7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libacl-devel-2.0.11-7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libattr-2.0.8-6.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libstdc++-devel-2.96-113.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/libtool-1.4.2-7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/m4-1.4.1-7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/mkisofs-1.10-11.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/ncurses-devel-5.2-26.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/openssl-devel-0.9.6b-35.7.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/pam-devel-0.75-46.7.3.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/readline-devel-4.2a-4.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/rpm-python-4.0.4-7x.18.i386.rpm
wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/dev-rpms/zlib-devel-1.1.4-8.7x.i386.rpm
#wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/smeserver-skel/smeserver-skel-0.2-01.src.rp
wget -c ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/XFree86-libs-4.2.0-8.i386.rpm
wget -c ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/tk-8.3.3-67.i386.rpm
wget -c ftp://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/expect-5.32.2-67.i386.rpm
#
# OK! - that's all the software fetched.
# Install the development RPMs.
#
cd /downloads/dev-rpms
rpm -Uvh --nodeps *.rpm
#
# Now we'll build a new version of OpenSSL. This will not
# replace the version supplied with SME server for general use
#
cd /downloads/boxbackup
tar -zxvf openssl-0.9.7f.tar.gz
cd openssl-0.9.7f
./config --prefix=/opt/openssl-0.9.7f
make
make test
make install
#
tar -zxvf boxbackup-0.09.tar.gz
cd /downloads/boxbackup/boxbackup-0.09
./configure openssl:/opt/openssl-0.9.7f/ link:-static
make
make test

# At this point all the software for both backup server and backup client has been built.

cd parcels
cd boxbackup-0.09-backup-server-Linux
./install-backup-server

# Now we'll make a user for the backup server AND a top level directory to hold
# the backups. The top level directory will ideally be on a separate volume and
# the documentation explains how to do this. However, for the sake of just getting
# the system working for testing purposes, I put the top level backup directory
# on the root volume of the SME box I'm using as the backup server.

useradd boxbackup
mkdir -p /earthbackup/backup
chmod -R 766 /earthbackup
chown -R boxbackup:boxbackup /earthbackup

# The raidfile.conf is now produced. Using this command the RAID is disabled.
# See the documentation for more details on using RAID.

/usr/local/bin/raidfile-config /etc/box 2048 /earthbackup

# Now we'll produce the backup server configuration file

/usr/local/bin/bbstored-config /etc/box mars boxbackup

# We'll now set up some of the keys required to run the system securely. The
# documentation warns against what I'm going to do here on security grounds, but,
# again, this is done in the interest of getting a test system working.
# I guess you could simply copy the following directory structure to a floppy
# and delete it off the hard drive and achieve the same result!

cd /root
mkdir boxkeys
cd boxkeys
cp /etc/box/bbstored/mars-csr.pem .
/usr/local/bin/bbstored-certs ca init
/usr/local/bin/bbstored-certs ca sign-server mars-csr.pem
cp ca/server/mars-cert.pem /etc/box/bbstored/
cp ca/roots/clientCA.pem /etc/box/bbstored

# Now choose a positive 31 bit account number out of thin air. For this exercise
# I chose to use 704747.
# Create the account

/usr/local/bin/bbstoreaccounts create 704747 0 4096M 4505M

# That's all there is to do on the backup server for now.
# Log onto the backup client as root. In this case the client is SME server Earth.

mkdir -P /downloads/boxbackup

# Copy (from Mars) the file /downloads/boxbackup/boxbackup-0.09/parcels/boxbackup-0.09-backup-client-Linux.tgz
# to (on Earth) /downloads/boxbackup

cd /downloads/boxbackup
tar -zxvf boxbackup-0.09-backup-client-Linux.tgz
cd boxbackup-0.09-backup-client-Linux

# Before going further, you need to establish that Earth can ping Mars. If 'ping mars' works,
# then skip this next bit. Otherwise, establish the IP address of mars and do the following ...

# mkdir -p /etc/e-smith/templates-custom/etc/hosts
# cd /etc/e-smith/templates-custom/etc/hosts

# Make a file called 30backuphostmars containing this one line:
# (Modify the IP address accordingly)

# 192.168.30.4 mars    (without the #)

# Then ...

/sbin/e-smith/expand-template /etc/hosts

# Now 'ping mars' again and this time it should work. If not, fix it!

cd /downloads/boxbackup/boxbackup-0.09-backup-client-Linux
./install-backup-client

# Configure the client to backup all the user areas and an iBay called 'shared files'.

/usr/local/bin/bbackupd-config /etc/box lazy 704747 mars \
> /var/backupd /home/e-smith/files/users/ /home/e-smith/files/ibays/shared-files/

# Now make a secure, offsite backup of /etc/box/bbackupd/704747-FileEncKeys.raw
# Without this file you have NO BACKUP!!!!

# Copy (from Earth) /etc/box/bbackupd/704747-csr.pem
# to (on Mars) /root/boxkeys

# ---- On Mars (the backup server where we started ...) ----

cd /root/boxkeys
/usr/local/bin/bbstored-certs ca sign 704747-csr.pem

# Copy (From Mars) /root/boxkeys/ca/clients/704747-cert.pem
# and /root/boxkeys/roots/serverCA.pem
# to (on Earth) /etc/box/bbackupd/704747-cert.pem
# and /etc/box/bbackupd/serverCA.pem

# ---- Meanwhile, back on Earth ... -----

# Edit /etc/box/bbackupd/NotifySysadmin.sh to make sure that error reports
# are e-mailed to the right place. (Or leave it alone for testing!!)

# That's it!. All you need to do now is start the server on Mars and the client on Earth.
# So .....

# ---- On Mars -----

/usr/local/bin/bbstored

# ---- On Earth -----

/usr/local/bin/bbackupd

# Now you've got it working, read the documentation at www.fluffy.co.uk AND SEND THE MAN AN E-MAIL!! He did all the work and it's nice to be appreciated!