[SATLUG] which backup medium/devices...

Borries Demeler demeler at biochem.uthscsa.edu
Tue Sep 29 06:56:52 CDT 2009


If you want a very primitive but effective solution to just backup a 
computer to a USB drive, I bought a 0.5 TB external USB drive which I
use to backup my laptop. The backup simply synchronizes a backup
everytime I run a little script:

************************************************************************
#!/bin/sh

DATE=`date +%m%d%y`
TARGET=/mnt

# backup laptop to USB drive mounted on /mnt, excludes /media, /proc, /sys, /mnt and /tmp

LOGFILE=$TARGET/tmp/laptop.$DATE.log
ERRORFILE=$TARGET/tmp/laptop.$DATE.err

echo "" >> $LOGFILE
echo "" >> $LOGFILE
echo synchronizing $x on `date`: >> $LOGFILE
echo "" >> $LOGFILE
rsync -av --delete --no-whole-file --exclude="media" --exclude="proc" \
--exclude="sys" --exclude="mnt" --exclude="tmp" / $TARGET/. >> $LOGFILE 2>> $ERRORFILE
************************************************************************

It won't back up /proc, /sys, /mnt and /tmp, instead, it saves a log file
of the backup in /mnt/tmp, which is on the backup drive (after mounting it on /mnt).

These backups are very quick since they only write what's changed. It also 
deletes on the UBS drive what was deleted on the laptop, so it is not good for
versioning. You may want to look into more sophisticated solutions if you need
versioning.

This approach is very affordable, quick and easy, and saved my butt the other day when
my laptop drive crashed, and I had my entire system working again in about 45 minutes
after installing a replacement drive. Fortunately, I had backed it up just minutes
before it crashed, so I lost nothing. I run this script once a day. The more frequently
you run it the shorter it takes.

Hope this helps someone...

-borries




More information about the SATLUG mailing list