Wednesday, January 30, 2008

Easy Backups: Cleanliness is Next to Godliness, part 2

Yesterday, I talked about how I back up my machine at work, and why.

I build my backup scheme around SVN, which I also use in my day job as Software Configuration Manager at Aztek Networks. It's easy, it's powerful, I know how to use it, and it even has unexpected side benefits.

How about my home machine?

On my home machine, I use git.

git is the SCM system used for the Linux kernel. The basic use is the same as SVN, but it has some real design differences. Every tree controlled by git contains the whole repository. It's self-contained, so you can carry it around with you.

It's built to be distributed: there is no central repository. This lets the thousands of kernel developers each have their own, entire, SCM system, without having to go through a central bottleneck.

As you'd expect, some very good synchronization tools come as part of it.

Actually, a lot of things come as part of it. Basic usage is commands that look like CVS or SVN -- git checkout and git merge instead of cvs checkout and cvs merge or svn checkout and svn merge -- but there's a lot more. My current suite has 58 git commands.

A pair of these are git clone and git pull. git clone creates a tree that's a clone of another. Later, git pull pulls new changes from the tree you cloned.

I keep my home directory under git. I used git clone to put a copy on a USB key drive. Every morning, I
  1. check in my latest changes
  2. plug in the key drive
  3. use git pull to synchronize the backup copy with this laptop
Ta-da!

Where do you get git? Here.

And why didn't I just embed the video? I've never done that and didn't have time to figure it out in this 15'.

No comments: