30

If I create a symlink inside Dropbox folder, pointing to another file also inside Dropbox folder (say, to maintain certain directory stucture), then Dropbox will try to de-reference the symlink and treat it as an normal file, instead of syncing it as a symlink. This could be very frustrating sometimes since I don't want to copies of the same file.

So my question is, is that a way to let Dropbox sync symbolic link just AS IT IS?

Jinghao Shi
  • 1,077
  • 2
  • 10
  • 15
  • 4
    I think this is an excellent question. However Stack Overflow is meant for questions related to programming. I think that this would have been a good candidate for http://superuser.com/ – Alfred Fazio Mar 15 '13 at 16:05
  • I think this has to be set up by design. While you may be competent in creating symbolic links, there is the use case where you can create an infinite loop by referencing a symlink back. For this reason, they can not reference a symlink to another dropbox location. You can create a symlink outside of Dropbox and it will read the contents ONCE and you have to restart Dropbox to have the contents referenced in the symlink scanned again. – Sun Oct 20 '14 at 16:38

2 Answers2

11

In the cloud the directory structure is not the same as in your computer. Therefore there is no way it will synchronize the symbolic link as it is.

In your computer, the link points to the absolute path to your original file (or folder). It looks like the following:

Original folder path: /Users/username/home/Documents/Dropbox/MyFolder/
Symbolic link: symlink -> /Users/username/home/Documents/Dropbox/MyFolder/

Since the cloud can't point to this same directory structure it will de-reference it and copy your files (on the cloud) all over again.

Links are great in Dropbox when it points to something outside your dropbox folder. This way the outside files will be copied to the cloud but wont be copied in your computer.

UPDATE: On the matter of relative symbolic links, I guess Dropbox can't sync as it is because your dropbox directory structure may be different from your colleagues.

For example:

       Your structure:   Dropbox/Projects/  
                           - coolfile.txt
                           - SharedDirectory/

Your friend structure:   Dropbox/SharedDirectory/

Relative Symbolic link inside SharedDirectory:  link -> ../coolfile.txt

The link will work your structure but not on your friends.

UPDATE2: links inside Dropbox are also being used to share content from within a shared folder with someone outside that group.

Zack Zatkin-Gold
  • 814
  • 9
  • 29
gibertoni
  • 1,368
  • 12
  • 21
  • 1
    Thanks for your answer. I can understand that Dropbox has to copy the actual file of a symlink if that link points to some file outside Dropbox. But it should also be reasonable that if the link points to a file INSIDE Dropbox, then Dropbox should just treat it as a link, right? – Jinghao Shi Mar 10 '13 at 05:53
  • It would be a nice feature. I don't know how complex it is for them to implement this though. In your computer this symlink would have a path, but on your friends computer (which is sharing this folder) would have another, and Dropbox should solve this conflict. Solving to one version should crash the other :/ – gibertoni Mar 10 '13 at 13:11
  • Your explanation doesn't consider relative symlinks – Otto Allmendinger Jun 05 '13 at 17:41
  • @OttoAllmendinger thanks for pointing that out. I updated my answer to specify this case as well. – gibertoni Jun 07 '13 at 02:53
  • 9
    This answer is not right. Many syncing tools do just what the OP has requested. E.g., the Unix tool rsync does. Also the Dropbox-like program BitTorrent Sync syncs symlinks like the OP has requested. Dropbox certainly could have implemented this feature, but they didn't. – Douglas Jul 13 '13 at 02:55
  • 2
    Dropbox has made no move to fix this even though it has been bemoaned on forums for many years. They got this design point flagrantly wrong vis a vis other software such as Unison, rsync, SpiderOak etc. I've discussed this in some blog posts: http://parfunk.blogspot.com/2011/02/dropbox-another-way-to-shoot-your-foot.html http://parfunk.blogspot.com/2011/02/dropbox-semantics-oh-that-there-were.html – RyanN Aug 13 '14 at 02:55
3

I've tried doing what you are trying to do. No luck. At the moment there is no way to get dropbox to sync symlinks properly. However, there is a feature request exactly about this. So cast your votes on the request and hope for the best.

trailmax
  • 34,305
  • 22
  • 140
  • 234