Neat Features of the Linux Dropbox Client

I've started using Dropbox instead of OneDrive1, and experimenting with the Linux client.

The Linux client2 has some pretty cool behavior in its handling of symlinks:

  1. If you put a symlink in your Dropbox, it uploads the file pointed to. Other clients sync down the actual file, while your machine keeps it as a symlink.

  2. If you take a file in your Dropbox and replace it with a symlink to that same file elsewhere on your machine, Dropbox doesn't upload anything because there are no changes to the data!3

  3. If another client makes changes to a file that's a symlink on yours, Dropbox deletes the symlink and makes it a regular file; this means that the symlink is effectively a copy-on-write entry in your filesystem.

  4. If you put a symlink in your Dropbox to another directory outside it, Dropbox uploads the files and they sync down to the other clients like normal. Unlike the previous point, though, if they are changed, the actual pointed to files are changed -- the copy-on-write thing doesn't happen.

Point number 4 is clearly because of the perf implications of copying an entire directory because one symlinked file changed.

The Linux and OS X clients also are aware of file permission bits. Well, the 'user' executable bit... it ignores the 'group' and 'other' bits, as well as all read and write bits. But changes to the executable bit do propagate to other Unix-y clients. It also looks like files uploaded from Windows all have the execute bit set, which matches what other software (e.g. Samba) does when confronted with the need to come up with Unix permissions for filesystems that don't have them.

Eventually I'm going to try writing a program that takes advantage of Dropbox's treating symlinks and files the same. I have a lot of music in my Dropbox that's also stored in another place on my home server, so it would be nice to replace those entries on that machine's local Dropbox folder with symlinks to its music file archive. It would be nice to have a program I could point at my Dropbox folder and my archive and say "hey, find all the duplicates in the Dropbox folder and replace them with symlinks", and then watch as nothing gets uploaded because from Dropbox's perspective, nothing changed! :D

  1. Because Dropbox is, in my opinion, a much nicer service than OneDrive, and also because I work for Dropbox now instead of Microsoft :)

  2. And probably the OS X client too; I just haven't tested it very much yet.

  3. It hashes the pointed-to file to check if it matches; if it doesn't, then the changes get uploaded.