« Hypermedia Project | Main | Oh Happy Day! »

Quick and Dirty Backups

I salvaged a nice big hard drive from my old computer, got one of those cheapo-bleapo USB external hard drive cases, and created a backup drive for athena. Pretty easy really, just a few screws, some cables and power and blamo - instant backups.

And none too soon either; athena will be going back to the computer store to get fixed. That's right, you reading this athena? I'm going to have you fixed. The white spots on the screen are getting fixed, and you're crashing problems are getting worked out too! So there!

For those of you interested in geeky crap, here's the script I used to make backups. It uses rsync, a nifty utility to make sure that two directories are syncronized. It is even smart enough to not copy files that haven't changed.

#!/bin/sh

SRC=/Users
DST=/Volumes/backup/backups

usage='usage: bak -n|-r full|clean|restore'
args='-auv -P --exclude-from=/Users/.backupexclude'

#echo `basename $0` $1 $2

case "$1" in
        -r) N='' ;;
        -n) N='-n' ;;
        *) echo $usage; exit 1;;
esac

case "$2" in
        full)  args="$args $SRC/ $DST" ;;
        clean) args="$args --delete --delete-excluded $SRC/ $DST" ;;
        restore) args="$args $DST/ $SRC";;
        *) echo $usage; exit 1;;
esac

sudo rsync $N $args

To use it, put this script in a file somewhere (mine is in ~/bin/bak). Then call the program with two arguments. -n to "fake" the backup, don't reallly do anything, just print everything that would have been done or -r, to really do the backup. full, to copy everything, clean to delete the stuff from the backup that you've deleted from the real directory.

There are probably better ways to do this, but it works for me. Works better than that hooked on fonics ever did.

About

This page contains a single entry from the blog posted on November 22, 2003 2:38 PM.

The previous post in this blog was Hypermedia Project.

The next post in this blog is Oh Happy Day!.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33