Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Sync to Dropbox from anywhere in your home folder Internet
I use Dropbox to keep files in sync between my work computer (a PC), my MacBook Pro, and an iMac at home. Although Dropbox is great, it keeps the files that it syncs to the cloud in a Dropbox folder. I have my own folder/file organization for projects, which I would prefer to maintain.

I found that I could keep a copy in the place where I usually would and sync with the cloud by creating symbolic links to the folders that I want to sync inside the Dropbox folder. Using this method, the file would be available in both places, without taking up any extra disk space.

To do this, you need to use the Terminal. Since Dropbox allows you to choose where your Dropbox folder resides, there's no "one size fits all" solution, but here's the general syntax (replace username, foldername, and path/to/dropbox with your own values):
ln -s /Users/username/Documents/foldername /Users/path/to/dropbox/Files/
You can also drag the source and destination folders into the Terminal window instead of typing the paths. Note that foldername has no trailing slash (/), but that Files/ bit does -- this is very important!

With symbolic links in place, you can save files where you normally would, and they'll still automatically sync to the cloud.
    •    
  • Currently 3.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[8,000 views]  

Sync to Dropbox from anywhere in your home folder | 14 comments | Create New Account
Click here to return to the 'Sync to Dropbox from anywhere in your home folder' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Sync to Dropbox from anywhere in your home folder
Authored by: pbassham on Thu, Oct 15 2009 at 7:51AM PDT
I wanted to do the same thing but am not too comfortable in terminal, but this little program adds a contextual menu item for "make symbolic link" with a right click in the finder. Awesomely simple.

http://seiryu.home.comcast.net/~seiryu/symboliclinker.html

http://wiki.getdropbox.com/TipsAndTricks/SyncOtherFolders



[ Reply to This | # ]
symbolic linker is also available as a service for Snow Leopard
Authored by: SuperCrisp on Thu, Oct 15 2009 at 10:31AM PDT
The subject really says it all; I'm only adding this comment in case someone else like me was wondering but lazy enough to not want to click the link and find out (also like me).

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: tatilsever on Thu, Oct 15 2009 at 8:20AM PDT
Can't you do this with aliases instead of symbolic links?

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: horhey23 on Thu, Oct 15 2009 at 8:28AM PDT
Nope, needs to be a symlink.

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: shauber on Thu, Oct 15 2009 at 9:31AM PDT
I've actually been doing the the other way around (moving the directories into the dropbox, and replacing them with symlinks). I thought dropbox would just sync out the link, and not the contents that were linked to. Good to know, and now I'll have to switch this all back :-D

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: everkleer80 on Sat, Oct 17 2009 at 9:51AM PDT
I do it the other way around too... If you want to use it to sync files between machines then I think you have to since you can't have one symlink pointing to multiple locations, but you can have multiple symlinks pointing to one location.

[ Reply to This | # ]
careful with alias !!! Sync to Dropbox from anywhere in your home folder
Authored by: vincentdavis on Thu, Oct 15 2009 at 9:46AM PDT
I had set firefox to download to a dropbox folder. I then downloaded Carbon Copy Cloner which extracts itself into a folder that has a sortcut to your applications folder. This turn out to be a big problem. The computer became almost usless when dropbox was becuase it was trying to sync the applications while they were running. Not sure of the details of why this is such a problem. The difficulty was finding where the problem was. On the computer it shows up as just a alias but if you go to the dropbox web you can see that it actually is syncing all the files.
The fix is also painful. Since the computer is nearly frozen when dropbox is running I had to delete the files from the web. But Applications are seen a folders so you run into a deleting to many files issue.
I think dropbox is great just be careful


[ Reply to This | # ]
Symlinks are different from aliases
Authored by: PCheese on Thu, Oct 15 2009 at 3:54PM PDT
Actually, Carbon Copy Cloner has a symbolic link to the Applications folder (not an alias). As described by this hint, adding a symbolic link to the Dropbox directory causes it to sync the original file or folder, which explains the behavior you saw.

As others have mentioned, aliases are not followed by Dropbox.

You're right, it's probably not a good idea to use your Dropbox as a downloads folder.

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: leamanc on Thu, Oct 15 2009 at 12:58PM PDT
Good hint, but this is not exactly news. People have been asking for "ad-hoc" Dropbpx syncing from the beginning, and it is covered on Dropbox's wiki pages how to do this. Dropbox says they plan on adding a true ad-hoc file sync feature, but for right now they point OS X and Linux users to symlinks as a workaround, and the equivalent feature in Windows (sorry, don't know what's it called off-hand in Windows).

And as mentioned above, aliases won't work. It must be symlinks, or Dropbox will just sync the alias file itself.

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: sojourner on Sat, Oct 17 2009 at 4:39PM PDT
It was news to me. Thanks for posting.

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: qprfact on Sun, Oct 18 2009 at 11:49AM PDT
This works really nicely - thanks! I have a question though, which will make my ignorance of symbolic links abundantly clear.

Say I have a directory with sub-directories, and I want to sym link all but one of those. Is that possible? It's essentially wanting to say "Link all of this directory with the exception of XYZ sub directory"?

Thanks in advance!

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: PeterSacreas on Thu, Oct 22 2009 at 11:37AM PDT
So I'm not the only "novice" regarding SymLink here. ;-)

The hint works fine with me when synching files from 1 laptop to the Dropbox cloud. I have folder "ABC" and put a symlink in the Dropbox folder.

But what if I want the same folder "ABC" in my iMac? Do I copy the files from the laptop to the iMac and then but a symlink of the iMac's "ABC" folder in the Dropbox folder of the iMac? Or will this put the double of files in the Dropbox server?

Many thanks for help,
Peter

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: Tommy_B on Thu, Oct 22 2009 at 2:56PM PDT
no, not at all. ;) The average OS X user isn't aware of this functionality... by Apple's design I would imagine, because it can easily break if you're not familiar with how symlinks work.

With symlinks, the file paths are absolute, meaning if you move the original file, you'll break the symlink, which is bad; in contrast, you can move the original file associated with an Alias as much as you want and the system keeps track of its location so when you use the Alias, it will behave as expected. Obviously, Apple needs to cater to its widest audience, hence it's all about the Alias. It'd almost be irresponsible to build a gui into OSX itself for symlinking simply because a lot of people would end up with a disaster of broken symlinks.

To answer your question: what I do and what I recommend others do unless there is some mitigating situation not allowing this, is to treat your Dropbox folder as a "master database," which is quasi-accurate description of it as it is a representation of what Dropbox stores in the cloud. Since you're syncing each Mac to Dropbox with (I assume) the intent of maintaining identical information on both machines, it naturally follows that you'd want your "master files" stored in the Dropbox folder.

I'll illustrate by example:
(By the way, you can never be too careful. Back up your folders and files involved first just in case something goes screwy, sync is not an infallible process!)
I want to have my feeds from Vienna reader available to me on any of my Macs (there's no built in sync). When I first set it up on Mac A & had all my feeds entered, I copied the relevant folder containing the feed info into my Dropbox folder; don't change the name of the folder or the contents as you'll likely run into trouble. I then deleted the original folder the application had set up. I created a symlink from the Dropbox folder to the default directory for Vienna data files.

I launched Dropbox on Mac A and let it upload the new folder, which was then downloaded to Mac B.

I hadn't configured any feeds on Mac B's Vienna installation so I just deleted Vienna's default folder right off the bat and created a symlink from the Dropbox folder that had just synced up to the directory where the default folder had been.

open Vienna on Mac B and there are all my feeds that I created on Mac A. And I've been in sync ever since.

For illustration, the specific entry I made on the command line
ln -s /Users/xxx/Documents/Dropbox/Vienna /Users/xxx/Library/Application Support/Vienna

As long as you have the same directory structure in place on your machines, you'd use the exact same command on each, adjusting for any change you might have in username amongst your machines; my boxes all have the same username.

Of note: If the two folders you are intending to sync up start out containing different data, you'll need to merge the contents onto Mac A before you do anything, otherwise you'll lose your data on Mac B. For instance, if I had feeds on Mac B Vienna already set up, I'd export them and import them into Mac A's Vienna before starting.

One last technical disclosure for the nit picky: Vienna allows you to move the location of the actual database file containing feeds through a command line entry; however, it does not support moving the entire Application Support folder which contains other data necessary to replicate your experience from machine to machine.

[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: Felix on Thu, Oct 22 2009 at 4:26PM PDT
Sounds about like the Peter Coxhead tutorial:

http://www.pxc.me.uk/misc/dropbox_mac_use.html

Convoluted process but it works OK.

[ Reply to This | # ]