This crude -but functional- script will backup everything under the sun to your external hard drive under a hard link farm. The directory name is a timestamp, and it maintains a symlink to the latest sucessful backup. Think of it as a Time Machine sans the fancy GUI.
#!/bin/sh
DATE=`/bin/date +%Y%m%d%H%M%S`
RSYNC=/usr/bin/rsync
BASE=/mnt/externalhd
TARGET=$BASE/daily
$RSYNC -av --exclude $TARGET --exclude-from=/etc/backup/rsync.exclude --link-dest=$TARGET/latest/ / $TARGET/$DATE/
touch $TARGET/$DATE/
rm $TARGET/latest
ln -s $TARGET/$DATE $TARGET/latest
Set it up creating an empty $TARGET
and symlink a dummy $TARGET/latest
to it. Populate /etc/backup/rsync.exclude
with lost+found
, tmp
, var/run
and everything else you need to skip during backup, or go for --include-from if it fits you better; man rsync
is your friend.
Proper sanity checks, error control, remote backup and pretty GNOME GUI are left as an exercise to the reader ;-)