Just sync symlinks


#1

Dear Madame and sir!

I am using syncthing for quite a while now and what really annoys me is that syncthing does not sync symlinks under Windows. I just want to replicate the Content of the symlink, it should be treated as a normal Folder.

Best regards, thejack


(Simon) #2

Hi thejack,

This came up many times before. The problem is, that there never was a solution that was both user friendly and save (as in not loosing data). See #1776 and #3387 (there is probably more on the forum on this topic).


(Jakob Borg) #3

And, as of next release, symlink support on Windows is removed entirely. It was broken for like a year or something and no-one noticed.


#4

could this be the reason, why all the symlinks on my windows machine are now overwritten with “real” folders ? (and therefore my harddrive fills up with lots of dupes)

or is this* just the “normal” (broken) behaviour, which I can’t remember to be so rude the last year(s).

(using v0.14.23 on mac and windows)

*this: I created a folder (A) with some symlinks on my win64 machine. The synchthing-folder has r/w access to folder (A) containing all the symlinks. Having shared that syncthing-folder to a mac device (r/w) resulted in overwriting all the symlinks on the windows machine, with “real” files and folders. thus, reducing my diskspace radically.


(Jakob Borg) #5

We take great care to never follow symlinks. This requires more care than you’d expect as symlinks on Windows are inherently completely broken (in my opinion, obviously). For example, if you create a “directory” symlink to .., and do a dir /s on Windows, it’ll recurse until it crashes.

v0.14.23 will still attempt to sync and maintain such symlinks, while future releases will take a more “what is this I don’t even” approach and not even try. In no cases should the symlink be replaced with what it points to, though.


(Dirk Heinrichs) #6

Hi,

I need to migrate a Jenkins server from Windows to Linux, taking all job configurations and build history with me on the way. My first attempt in copying the data over was with cwRsync. This was able to copy everything incl. symlinks (Jenkins uses them to mark last failed or stable builds, for example), but due to the sheer amount of data, this approach wasn’t feasible.

Since I also use SyncThing for other things already, I tried this approach, only to find out that symlinks are not supported on Windows, which I can’t understand. They just work fine, and, as the rsync example above shows, they can even be reproduced on Linux.

I also can’t reproduce the “dir /s” example you mention. There’s no recursion whatsoever, on both Windows Server 2008 R2 and 2012 R2.

So, I grabbed the ST sources and modified them to support Symlinks on Windows, and it’s working just fine, at least for my use case.


(Dirk Heinrichs) #7

Sorry, didn’t read the “recursion” part properly and didn’t recognize the “..” thing. Didn’t test that, of course. But who would create such links anyway? :wink: