Tuesday, January 29, 2008

Easy Backups: Cleanliness is Next to Godliness

I do backups. No, really.

I even back up my own desktop box at work. For historical and manpower-shortage reasons, IT only backs up servers; I may be the only person whose desktop is backed up.

I don't bother to back up my OS. I take updates every day, as they come in, and I install the most recent release of whatever Linux distro I'm running as soon as it appears.

Packages? Yum and apt are such good package installers, that I can't remember the last time I built something from a tarball. I'm more accustomed to apt and its relatives, like Synaptic, because I'm running Ubuntu, but I've used both.

By default, bash on Ubuntu even tells me what package I'm missing if I try to use a command and it isn't installed.
jsh@jsh-laptop:~$ logtail
The program 'logtail' is currently not installed. You can install it by typing:
sudo apt-get install logtail
bash: logtail: command not found
(For other distros, this behavior is a shell option.)

My home directory is a different story: it's idiosyncratic and irreplaceable.

What do I use? I do Source Code Management on it. I'm an SCM guy, so it's second-nature.

At work, I set up a Subversion (SVN) repository on my desktop, and check-in my home directory every day. Then I rsync my SVN database with a 4G USB thumb drive. The drive's not even close to full, and affordable key drives are growing faster than my repository.

An unanticipated side-effect is that I finally, now, clean up my home directory.

I'm a pack-rat, and used to accrue files, which stayed around for years after I'd forgotten what they were for.

Now, I just do an "svn stat" at the top level and deal with every file that SVN tells me it doesn't know about. Either they go into the repository, with a comment that says what they're for, or they get removed. Daily.

My script to "snapshot $HOME to SVN" doesn't let me take the snapshot until all these files are handled.

So, first thing in the morning, I come in, pull the key drive out of my desk, pop it in, and run the script. It forces me to clean up, then snapshots to SVN, and then rsyncs the repository with the thumb drive.

Then I put it away. GTD.

Cleanliness is next to Godliness.

Large code trees, which I always have several of sitting around for work, are handled by the corporate SVN server, hosted on CVSDude. I put them in ~/tmp, where they come and go, and use svn:ignore to tell my desktop tree that it doesn't need to nag me about them.

But how do I handle my home machine -- this laptop? Stay tuned. My 15' is up for today.

No comments: