Index: [Article Count Order] [Thread]

Date:  Mon, 01 Jan 2007 16:39:27 +0000
From:  Dogsbody <dan (at mark) dogsbody.org>
Subject:  [coba-e:08448] Re: Backup solution
To:  coba-e (at mark) bluequartz.org
Message-Id:  <4599393F.1000500 (at mark) dogsbody.org>
In-Reply-To:  <003201c72ccf$749ff180$3701a8c0@lapxp>
References:  <003201c72ccf$749ff180$3701a8c0@lapxp>
X-Mail-Count: 08448


> Dan says it uses rsync and CMU as a PART of backup solution.
> I assume there is more than simply plugging them both, right?
> And it is called backup SOLUTION, so it might be more complex than that.

It's not really any more complex!  Run CMU on the remote host via SSH and back 
it up with rsync and all the correct options :-)

The scripts just pull it all together and do such things like...
- Lock files to avoid duplicate backups
- By default it backs up all hosts in a list one after each other
- Allows me to force a one off backup straight away if needed
- Allows me to quickly do a compare and show changed files
- Puts the nightly logs in directories so that I can find them
- Reports if transferred/changed files contain "/bin" in the path (not the best 
but I certainly want to know if any bin files have changed!)
- Reports to me for problems with a backup
- Has an "exclude" file for each host that lists things not to backup (just 
/proc , /dev , /sys & /var/named/chroot/proc really)
- Kicks off the pre-backup script on each host and reports if there were problems.
- Sorts out what was the last good backup was to use as the --link-dest directory
- Deletes the old backups keeping the daily backups for 30 days, one backup a 
week for the previous month and one backup a month previous to that.  (OK I 
haven't actually written this bit yet but I'm waiting to build a nice set of 
daily backups :-) )

As I say, I didn't really want to write my own script but I couldn't find any 
apps that came near to doing all of the above.

You don't have to do all the things I did.  If you just want a nightly backup of 
your server then you don't need to do half the things above!  I have been using 
rsync to backup my boxes to a static directory for a number of years now and 
this was just the next logical progression for me.

If I felt more confident about my shell scripting I would definitely release it 
but... I don't :-p   The scripts are very basic but I wrote them for me on the 
server they were going to be run on with real paths etc.  I'm sure if anyone 
else saw them they would shout at me for bad coding! :-)

Dan