Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 2.90 / 5
  You rated: 3 / 5 (21 votes cast)
 
[49,522 views]  

Sync to Dropbox from anywhere in your home folder | 18 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 whoever posted them. This site is not responsible for what they say.
Sync to Dropbox from anywhere in your home folder
Authored by: pbassham on Oct 15, '09 07:51:24AM
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 Oct 15, '09 10:31:35AM

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 Oct 15, '09 08:20:09AM

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 Oct 15, '09 08:28:32AM

Nope, needs to be a symlink.



[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: shauber on Oct 15, '09 09:31:36AM

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 Oct 17, '09 09:51:55AM

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 Oct 15, '09 09:46:44AM

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 Oct 15, '09 03:54:08PM

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 Oct 15, '09 12:58:03PM

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 Oct 17, '09 04:39:32PM

It was news to me. Thanks for posting.



[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: qprfact on Oct 18, '09 11:49:23AM

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 Oct 22, '09 11:37:30AM

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 Oct 22, '09 02:56:57PM
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 Oct 22, '09 04:26:36PM

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 | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: krbusby on Jan 16, '11 10:41:33AM

I used a program called Symboliclinker which has a GUI, which I needed. It works fine, giving me a menu option to create a symbolic link and the new symbolic link represents the folder it's linked to perfectly. However, if I create a file in the folder the symbolic link to that folder does not reflect that change. Even after I reboot. Do symbolic links not refresh themsleves to keep up with the folder they're linked to?

Thank you for any insight.

Macbook, Leopard OSX 10.6.6.



[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: everkleer80 on Jan 17, '11 10:05:02AM

Hmm... there shouldn't be anything to refresh. A symbolic link is basically a pointer to the original file or folder; it is not a separate file or folder that needs to be kept in sync with the original. It sounds like the utility you use may not actually be creating a symbolic link. You can check this through the Terminal. I'm guessing you aren't to Terminal-savvy, but if you type ls -l [foldername] where foldername is the folder containing the symbolic link, then the first letter on the line containing your sybolic link should be a lowercase L, not a D; if it is a D then that means it is a separate folder, not a symbolic link. The directory listing for the original folder will always start with a D, and entries for any symbolic links will always start with an L.

For example if I have a sybolic link called Files in my Dropbox folder linking to Files in my Documents folder, then if I go into Terminal and type ls -l ~/Dropbox then I would see something like lrwxr-xr-x 1 dan staff 41 Feb 18 2010 Files -> /Users/dan/Documents/Files/. (The ~ in the ls command is a shortcut that always means the home folder of the currently logged in user - so in my case, /Users/dan/Dropbox is the same as ~/Dropbox)

[ Reply to This | # ]

Sync to Dropbox from anywhere in your home folder
Authored by: krbusby on Jan 17, '11 02:10:51PM

I feel bad for waiting your time. You put so much into your answer.

The problem was that I had reinstalled my OS recently and when I installed Dropbox I forgot to create new symbolic links. It seems that reinstalling Dropbox and having breaks the symbolic links even though they show in my Dropbox folder. Once I deleted those and recreated them everything was fine and any change to the original folders is immediately reflected in the symbolic links now.

Thank you very much for your reply. You may treat yourself to a beer!



[ Reply to This | # ]
Sync to Dropbox from anywhere in your home folder
Authored by: everkleer80 on Jan 17, '11 06:43:59PM

That's quite alright, I was just procrastinating at work lol! Glad you got it cleared up!



[ Reply to This | # ]