Tuesday, February 24, 2009

Carrying around my Dropbox (on removable media)

I keep a small set of files with me at all times; these are my essential files I keep backed-up so even if my computer dies, I can recover my basic information... my personal to-do list, contact list, etc. I can access these files at work, at home, and even on my phone. (Unfortunately, I just learned that a Mac will not read the file system, so I've got to find a way to deal with that). I've tried a few tools to help me keep my files in sync (Darcs, SVN), but recently I switched to Dropbox; it does a fantastic, trustworthy job automatically, so I highly recommend it.

Unfortunately, I've hit a couple of snags trying to keep these files with me. This post is all about what I've done to solve these problems.

I need to access my Dropbox files from removable media (even on Windows).

I read (and edit) my files on my phone sometimes; I haven't had a data-plan, so I've been copying files on and off an SD (or recently a microSD) card that I can edit on-the-go. By default, Dropbox will not allow you to install your files on a removable drive, so I cannot put these files on my micro SD card that I keep with me and use on my phone. (Actually, I could copy the files, but now that I can edit files on my phone I want to be able to plug the card into a computer and let it sync them all automatically.)

On *nix and the Mac, there's no problem installing to a different location.

On Windows, things are tricky. There are 3 tools on the Dropbox site that might help with this: Dropboxen, DropboxPath, and DropboxDataWrapper. I finally got DropboxDataWrapper to do what I want:

  1. Shutdown your running Dropbox.
  2. Run DropboxDataWrapper as indicated and specify the path on the external drive where you want the files.
  3. At the end, be sure NOT to check the box saying "I want to choose the location"; after you click "go to my dropbox" it'll complain about not finding things in the default location, but you'll see it running and you'll see it download things just fine to the path you specified. Note that if you right-click on the Dropbox service and select "Open My Dropbox", you'll get an error about the wrong location, so you'll always have to browse to that folder manually.
So by default, Dropbox will sync up my files from my default location, but then I can stop Dropbox, plug in my card, and run DropboxDataWrapper to sync it up.

(FYI: I couldn't get Dropboxen to work at all, and DropboxPath just changed my current path but didn't allow me to run Dropbox for my both removable disk and the default location.)

This isn't perfect: I've found a computer where DropboxDataWrapper didn't work right the first time, but I didn't have time to investigate so I quickly gave up and tried something else.

I need to be able to update my removable media from any OS (Linux and Windows).

After I saved my files to my card, things are great except that I had 2 versions of my Dropbox on there, one for Windows and one for Linux. Thankfully, each OS uses different configuration files, so I found I could put them all in one location and things are working; when I get on Windows and plug in, my files sync up, and then later when I get on Linux they sync up there, too. Here's how I set it up:

  1. Change all your Windows files and directories to writable. I did this at the level of my Dropbox folder:
    chmod -R u+w .

  2. Copy the .dropbox files from your Linux files on the external card into the same place in the Windows files on the external card. I only had three: one at the same level as Dropbox, one under Photos, and one under Public.
  3. Make a folder somewhere else to hold your Dropbox files. (You cannot do this on your card if it's formatted with a Windows filesystem because the next step will fail; Linux won't allow you to create the symbolic link.)
  4. Inside that folder, create a symbolic link to the Windows "My Dropbox" folder.
  5. Copy the .dropbox folder from your Linux files on the external card (at the same level as the Dropbox folder) into the Windows files on the external card (at the same level as the "My Dropbox" folder).

Now, it looks like each OS has a different version of some .dropbox files when I have shared folders, so we'll see what happens with those.

Hope this helps. I'll update this post if I learn more.