Why bother? It's important to back up data because eventually all drives will die. Incremental backups are important because it allows you to track changes from day to day. The solution I have here isn't perfect, but it allows for a few folders to be saved for 30 days before they are overwritten. The benefit of this is that if a huge error is caught 5 days after it was made, then you can revert to the file that was saved 6 days ago.
Following is the script that does the job. I named this file backup.sh and had it run every day at 3am, when nobody is likely to be editing or messing with files. The result of the code is a disk image (.dmg) that will be password protected, and will have the name of backup[1-31].dmg (based on the current date). You'll need to edit the first few variable to match your setup.
# Dropbox as incremental backup. # Justin Schwalbe # http://finishtherace.net/wp/?p=622 password="trickypassword" dropboxdir="~/Dropbox/backups/" #change this as needed, make sure it exists backupfolders="/path/to/folder /path/to/second/folder /and/so/on" ############################## # No need to edit below this # ############################## datestring=`date +%d` thisyear=`date +%y` thismonth=`date +%m` today=`date +%m.%d.%y | sed -e s/^0//` dir="Daily" #seems dumb and redundant, but it is sorta needed mkdir /tmp/Backups; cd /tmp/Backups tar -czf backup$datestring.tgz $backupfolders tar -zxf backup$datestring.tgz rm backup$datestring.tgz # hdiutil won't overwrite files, so if it exists, delete it. if [ -f $dropboxdir/backup$datestring.dmg ] then rm $dropboxdir/backup$datestring.dmg fi # create the .dmg file hdiutil create -srcfolder '/tmp/Backups' -encryption -passphrase $password -fs HFS+ -volname Backup$thismonth.$datestring.$thisyear $dropboxdir/backup$datestring # clean up our mess so tomorrow we can start fresh rm -rf /tmp/Backups
See entire post and instructions at my blog, and download the script here.
[crarko adds: I haven't tested this one.]

