Koozali.org: home of the SME Server

A very neat server to server backup solution (BoxBackup)

dave_d

A very neat server to server backup solution (BoxBackup)
« on: March 18, 2005, 01:06:47 PM »
For some time now, the making of good, acceptable backups has been causing problems.  These problems are being exacerbated by the ever growing capacity of hard drives.  Whereas, not long ago, a single hard drive could easily be backed up onto a tape, the situation is now that backing up a single 120Gb HDD simply cannot be done to tape - at least, not an affordable tape.

I have experimented with doing 'tar ... <everything>' and 'tar ... <selected things>' to both local and remote hard drives, but this method needs constant maintenance if things are to be kept under control.

In line with my policy of assuming that someone somewhere will have solved my problem - if not completely then partially - I was again searching the Internet the other day when I came across a product called 'Box Backup'.  To my delight, as far as I can yet determine, this little system solves my present backup problems.

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.......

Log into Mars as root.
# mkdir -p /downloads/boxbackup
# cd /downloads/boxbackup

! Get the source forom the following link - http://prdownloads.sourceforge.net/boxbackup/boxbackup-0.09.tgz?download
! Put the source into /downloads/boxbackup

# tar -zxvf boxbackup-0.09.tgz
# cd boxbackup-0.09
! See the documentation on www.fluffy.co.uk/boxbackup for explanation about openssl
!
! NOTE:  The author of BoxBackup STRONGLY discourages the use of any OpenSSL less than 0.9.7.  However, as I didn't have time to
! figure out how to install 0.9.7 I've stuck with the 'allow-old-openssl' option.  If anyone has time to figure out how to update
! the SME server version, please add to this HowTo.
!
# ./configure allow-old-openssl
# make

! 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

! 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

! Now, tthere's a problem with the file called bbackupd-config.
! Edit this file with (say) pico and make the following change to line 231.

! Change ....
                 if(system("openssl rand -out $enc_key_file 1024") != 0)
! to ...
                 if(system("openssl rand 1024 > $enc_key_file") != 0)

! When the change is complete, continue ....

# ./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) /etc/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!

Regards,

Dave

mbachmann

A very neat server to server backup solution (BoxBackup)
« Reply #1 on: March 18, 2005, 02:39:48 PM »
dave_d, i've prepared a wiki page for you to type in your howto for us, if you like. Just hack in you text using the "edit" button at the  right bottom of the page and follow the formatting rules below the page. Go here: http://no.longer.valid/phpwiki/index.php/BoxBackup

See http://no.longer.valid/phpwiki/index.php/Compaq%20Proliant%20DL%20380%20G4%20Installation for wiki text formatting examples (also using edit on this page).

mbachmann

A very neat server to server backup solution (BoxBackup)
« Reply #2 on: March 21, 2005, 09:47:36 AM »
Dave, i've seen you did type it in. "We" and contribs-docteam in particualr appreciate your work and would like to thank you very much.

Offline kmccarn

  • ****
  • 112
  • +0/-0
A very neat server to server backup solution (BoxBackup)
« Reply #3 on: March 21, 2005, 02:52:55 PM »
If you could add links to the binaries for SME 6.0.1 - it would save me a lot of time....

I think I can use this for at least one of my clients.

Thanks for all the work.

 :-D
Kevin in WV 8-)......

dave_d

A very neat server to server backup solution (BoxBackup)
« Reply #4 on: April 06, 2005, 07:31:37 PM »
If anyone's still interested, I rebuilt Boxbackup on a clean 6.0.1-01 server and this time I got it to use the latest OpenSSL stuff.  For details see the WIKI page (assuming I edited it correctly).  I can make the binary images required on 'server' and 'client' available if someone has somewhere for me to upload them to.  That would save you having to go through the compilation phase - you still have to configure it.

Regards,

Dave
 :pint:

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
A very neat server to server backup solution (BoxBackup)
« Reply #5 on: May 25, 2005, 03:43:21 AM »
I'm interested in having a rpm to install this system. I need something to easyly do remote backups. Besides, I don't want to install dev onto my server...

Thanks for any help.
Sophie from Montréal

wallyrp

A very neat server to server backup solution (BoxBackup)
« Reply #6 on: May 25, 2005, 08:38:31 PM »
Good Afternoon,

Why get an rpm when you can just copy the information from the how-to that has been created and paste it into a script file.

Question, was wondering why one of the wget lines was commented out?

#wget -c http://mirror.contribs.org/smeserver/contribs/hpe/devtools-6.01/smeserver-skel/smeserver-skel-0.2-01.src.rp

Just curious.

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
A very neat server to server backup solution (BoxBackup)
« Reply #7 on: May 26, 2005, 03:56:55 AM »
It seems to me that I need to compile the program.
Am I right ?
Sophie from Montréal

dave_d

A very neat server to server backup solution (BoxBackup)
« Reply #8 on: May 26, 2005, 12:41:13 PM »
- Wallyrp ----  I can't recall why that line's commented out.  Presumably I found out I didn't need it!  There's certainly nothing sinister here!

 - soprom -- Yes, you need to compile it.  Just put the dev rpms onto your system, build the thing, and then remove them.  As the SME development stuff is in the form of RPMs, this is not a difficult thing to do!

 - Everyone -- It would be nice if someone could confirm that I didn't make a hash of editing the wiki.  I found some notes yesterday that imply that I've left a bit out!  It seems that I built an updated OpenSSL on BOTH boxes - not the one as implied in the Wiki.

It would be nice if someone other than me could confirm the build procedure  :-D

Offline jester

  • *
  • 496
  • +1/-0
Bare-metal restore (disaster recorvery)
« Reply #9 on: May 27, 2005, 11:18:33 AM »
Quick question.... is there an option for a bare-metal restore of some sort on Linux and/or Win?!

Jester.

dave_d

A very neat server to server backup solution (BoxBackup)
« Reply #10 on: August 04, 2005, 04:49:26 PM »
Hello Readers!

Did anyone try this system?  I've been using it for several months now with absolutely no problems.  It's certainly the easiest backup I've ever used.

Regards,

Dave.

Black

A very neat server to server backup solution (BoxBackup)
« Reply #11 on: August 05, 2005, 06:27:50 PM »
I looked at the site. It hasn't been updates in 8 months or so..

dave_d

A very neat server to server backup solution (BoxBackup)
« Reply #12 on: August 06, 2005, 12:31:31 PM »
Err ... excuse my ignorance, but what's that got to do with anything?  Were you expecting some updates?

Black

A very neat server to server backup solution (BoxBackup)
« Reply #13 on: August 06, 2005, 04:21:03 PM »
Sorry it just looked like there was nothing going on, Like it was dropped mid stream or something.

Offline ajkeane

  • *****
  • 187
  • +0/-0
    • http://keane.co.nz
A very neat server to server backup solution (BoxBackup)
« Reply #14 on: August 07, 2005, 07:07:01 AM »
Dave_D

I have got as far as compiling this and am hoping to complete the implemenetation soon.

I will let you know how I get on once I have got the last parts complete.

I have had no issues with your how to. Everything seems to work.

I am hoping to set this up as an offsite backup solution using ssh connections so it will be interesting to see how I get on.

As I say I will keep you informed.

Tony
...