Aaron Parecki
@twilio Hey how'd you know I'm hacking on a side project tonight? I'm working on building the API for http://geoloqi.com right now... 7/31 9:40pm
@maxticket Try GlovePIE http://aaron.pk/1MT, I used it to make music with a wiimote: http://aaron.pk/1MU 7/31 8:35pm
@TechWraith @maxticket @skry I use Aptana because it has great SVN integration and the global find/replace and code hinting is great. 7/31 8:00pm
@TechWraith Emacs has a functioning implementation of HTCPCP, the Hyper Text Coffee Pot Control Protocol http://aaron.pk/1MJ 7/31 4:08pm
@oscargodson Go to your "history" page and click the X that appears on hover http://aaron.pk/1M4 7/30 6:09pm

Dropbox is great. Most of the time. It’s great when I need to easily share files with people while working on a project together. It keeps files in sync between multiple computers, and is the only solution I’ve found so far which works seamlessly and instantaneously. If you don’t already use it, I highly recommend it.

Dropbox - Online file backup and sharing

Dropbox - Online file backup and sharing

I’ve recently been having problems with Dropbox ever since joining a shared folder which overflowed my quota. Completely unrelated files mysteriously disappeared. Luckily I had a snapshot from before I had joined the folder and was able to restore the files.

This prompted me to set up a proper backup system which makes snapshots daily, weekly and monthly.

This guide assumes you have a Linux server somewhere with no GUI.

First, follow the Dropbox wiki instructions for installing Dropbox on Linux. The process is relatively painless, and seems to just work. At the end, you’ll end up with a “Dropbox” folder in your home folder. This folder will always have the latest version of your files.

The next step is to take snapshots of that folder at regular intervals. I chose to keep 7 days of daily snapshots, 4 snapshots taken weekly, and 12 taken monthly. In theory, this should give me access to any files I’ve accidentally deleted within the past year.

This script will run rsync to clone the Dropbox folder into snapshot folders which will be overwritten over time, so you will only end up with 7+4+12 copies of your Dropbox folder. Save this code to a file called backup.sh or whatever you want, and make it executable (chmod 755 backup.sh).

backup.sh:

#!/bin/bash
 
# Makes daily snapshots in folders like "daily-4-Thu", "daily-5-Fri"
if [[ "$1" == "daily" ]]
then
        path=daily-`date +%u-%a`
fi
 
# Makes weekly snapshots in folders like "weekly-1" where 1 is the day of the month
if [[ "$1" == "weekly" ]]
then
        path=weekly-`date +%d`
fi
 
# Makes  monthly snapshots in folders like "monthly-04-Apr"
if [[ "$1" == "monthly" ]]
then
        path=monthly-`date +%m-%b`
fi
 
# Run with "go" as the second CLI parameter to actually run the rsync command, otherwise prints the command that would have been run (useful for testing)
if [[ "$2" == "go" ]]
then
        rsync -avz --delete /home/aaron/Dropbox /home/aaron/aaron/Dropbox-Backup/$path
else
        echo rsync -avz --delete /home/aaron/Dropbox /home/aaron/Dropbox-Backup/$path
fi

Add these lines to your crontab to run the backup script at the appropriate intervals. This will run the daily script every night at 1am, the weekly script on the 4th, 12th, 20th and 28th days of the month at 1:30am, and the monthly script on the 1st of the month at 2am.

crontab:

0 1 * * * /home/aaron/backup.sh daily go
30 1 4,12,20,28 * * /home/aaron/backup.sh weekly go
0 2 1 * * /home/aaron/backup.sh monthly go

Hopefully this saves you some headaches down the road when Dropbox decides to play tricks on you.

Current Location
aaronpk is in Portland
aaron.pk
Voice +1-765-314-1599
Portland, OR
USA
AIM