While I’m entirely sure that I’m not the first to have thought of this, I confess to being entirely unaware there was a mechanism for incorporating external assets into your primary Dropbox directory. Instead, I was operating under the assumption that Dropbox would only synchronize that directory and only that directory’s contents. If I wanted to pull in /home/sog/Music, then, I had two choices: a.) move it into the Dropbox folder, or b.) make Dropbox synchronize the parent directory – in this case, /home/sog.
If the latter were an option, frankly, I would be doing just that, because it would be nice to have my home directory mirrored on the other machines I use. But even at the premium, for pay level – which I have purchased – I’m only given 50 GBs to work with, which isn’t enough. So that option is out. And moving my music directory around would break my library, my eMusic download path, and a couple of other things: not unrecoverable, but inconvenient.
Instead, what I’d like to do is leave the Dropbox directory alone, but have it yank in a few select external folders to be synced. Which can be done, fortunately enough.
All you have to do (on Linux, anyway) is create a symlink from the Dropbox directory to the folder you want to incorporate. Here’s how you do that:
cd /home/yourusername/Dropbox</code (or whatever path you've selected as your Dropbox root
ln -s /home/yourusername/Music Music
(where the first parameter is the external directory name you want to draw from, the second the name of the pointer in the Dropbox folder)
And voila, you're done. This creates a symlink in the Dropbox directory to the external folder, meaning that although the files have not moved, they virtually appear in the Dropbox directory, at which point the app will dutifully begin syncing them up to the cloud. Problem solved.
A few caveats.
- According to Corey, this only works if you symlink out from the Dropbox directory; it won't function if you symlink into it.
- Be careful what you're synchronizing; the risk of collisions, for example, is significant if you're Dropboxing Tomboy notes on two machines (as I am), as Sandy points out. Speaking of, Cimi has a different approach for Dropboxing Tomboy specifically, which is worth reading.
Otherwise, enjoy: I hope this helps.
Mike Dolan says:
October 17, 2008 at 2:17 pm
Are you using a theme on Ubuntu there or is that just a lot of self tweaking to get the black working right?
Erik says:
October 17, 2008 at 3:35 pm
Also keep an eye out for the “recent changes” spam if you’re actively editing (and constantly saving) a file in a synced directory. It’s more of an annoyance then a real problem.
James says:
October 17, 2008 at 9:37 pm
Mike: That looks like the Dust theme.
sogrady says:
October 17, 2008 at 9:43 pm
@James: excellent guess. that’s exactly what that is. the odds of something i tweaked looking like that are near zero 😉
Kevin Schmidt says:
October 19, 2008 at 7:10 am
Symlinks on Linux/Unix/Solaris/BSD/etc. are wonderful things for many reasons, this being just one of them, and a key reason I dislike Windows. How for example is one supposed to easily have Java applications pointing to a JRE directory and have them not break when you install a new version that has a different directory name? On *nix, just have a symlink /usr/java to wherever it is an voila you’ve isolated the apps from the physical directory location.
Asbjørn Ulsberg says:
October 21, 2008 at 1:57 am
Wonderful tip. I’ll try to employ it on my OS X machine as soon as I get home today. I wish I were able to do the same on Windows, but as in most areas, Windows just plainly sucks too much to give this kind of functionality. Being able to synchronize work documents from my Windows box would be neat, but alas we’re not close enough to a solution to even be thinking about a cigar. Windows blows!
the-way-to-the-centre » dropbox symlinks says:
December 18, 2008 at 12:24 am
[…] aliased folder however, were not. A few repeat & fails later a bit more searching brought me to this post that stated that this only works if you symlink out from the Dropbox […]
Rob says:
February 16, 2009 at 5:17 pm
Just wondering.. To pull off this trick on Windows, maybe you could use NTFS reparse points to pull in other folders (google “sysinternals junction”). I can’t try it as I’ve rather dumbly left my Dropbox on a FAT32 partition 🙁
Santo says:
April 6, 2009 at 11:54 pm
FYI: Windows also supports linking but they tend to call it a junction.
And I can definitely recommend you the following application, which makes it really easy to create all kinds of links on a windows pc (junctions, hard links, …):
http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html
Rob the Geek :: Driving DropBox - Linking External Directories in Windows says:
April 21, 2009 at 1:12 pm
[…] to be run FROM your DropBox directory, so be sure to cd /home/yourusername/Dropbox first!. Check this great article for more from a Linux HOWTO […]
Symlink and DropBox on MacOS « giant. freakin. robot. says:
July 31, 2009 at 2:17 pm
[…] http://redmonk.com/sogrady/2008/10/17/trick_dropbox/ […]
tecosystems » There’s More to Dropbox Than Piracy says:
September 30, 2009 at 3:43 pm
[…] either drop them into your Dropbox folder, or create symlinks out to them from there. Here’s how to do that. Items that I back up – using the term loosely, as there’s no versioning, etc […]