Cheap Automatic Backups With Dropbox
Dropbox* is great for sharing files among multiple machines, and it's
also pretty good for automatic backups. The only problem is that, if
you're cheap like me and want valuable services for free, you can only
get 2 GB of space. My home directory has more than 2 GB worth of
files. Some of them aren't important enough to back up, though, and,
fortunately, it seems the really big files usually fall into that
category.
size=`rsync --delete --delete-excluded -pthrv --exclude-from \
/Users/paul/.backup/exclude /Users/paul/Documents/ \
/Users/paul/Dropbox | egrep -o "total size is (.*)G" | egrep -o "[0-9\.]+"`if [ "$size" = "" ]; then
size=0
fiif [ `echo "$size < 1.8" | bc` = 0 ]; then
echo "`date`: WARNING: Size is running out for Dropbox backups.\
(Currently using ${size} GB.)" 1>&2
elif [ "$1" != "" ]; then
echo "size: $size GB"
fi
and a ~/.backup/exclude:
ita/*
SesSys08/*
*.mat
HIUS*
EYH/*
*.pack
*.dat
dev/old/*
WebKit/*
build/*
Basically a list of patterns matching either old cruft or files that
really don't need to be backed up, like Xcode build directories.
*/10 * * * * sh .backup/backup.sh
That means that every 10 minutes the backup script runs. This is
pretty frequent, but rsync only copies the parts of files that
actually changed, so it's pretty fast.
space, I automatically get an email when my Dropbox account is about
to fill up. (You can also check this through the Dropbox utility, but
not as easily remotely.) So far, the only maintenance has been adding new patterns to my
~/.backup/exclude file; otherwise, it's nice and automatic. And it's
saved me a trip back home a few times already, when I forgot to
transfer important files to my laptop.
* referral link... they'll give both you and me 250 MB extra space if you sign up through it.
Comments [0]




