Option to follow directory junctions / symbolic links?

Is it a setting? Because I can’t find one and it’s not working for me. I am a returning Syncthing user, I used it years ago and trying to see it will work for me to replace Resilio.

Add an option to follow symlinks instead of syncing them “as is” · Issue #1776 · syncthing/syncthing (github.com)

This has been cooking for a long time and each attempted implementation has run into unanticipated difficulties. Given that and the theoretical difficulties of ensuring correctness in the presence of (followed) symlinks I’ve decided that following symlinks will not be implemented. I’m also locking this issue because I don’t want followup arguing about in the bug tracker. Anyone is welcome to argue about it on the forum, but unless the argument is backed up by a foolproof implementation it’s unlikely to have a positive outcome. Sorry, peeps.

I just realized, that is your reply @calmh. Is this thread not the same thing?

There’s a new advanced folder setting “Junctions as dirs”. The feature and it’s issues are discussed (in part) in this thread. The feature treats Windows directory junctions like a “normal” directory.

Oh, I was looking in the wrong place, I found it.

I enabled it for a test folder with a Junction Point in it, but that is not working.

Enabled for directory Temp. Added Junction Point to Temp2.

Not syncing:

image

Are you using the newest version of Syncthing? In one of the previous ones, there was a bug that required you to restart the program in order to “see” the junction points.

I just downloaded it: v1.18.0

Well, yea, it required a restart.

To be specific, it does not require a full restart, but it does require the folder to be paused and resumed to trigger.

For reference:

https://github.com/syncthing/syncthing/issues/7371 https://github.com/syncthing/syncthing/issues/7850

1 Like

Hi,

I see the latest posts are from 2021. Is the “follow symlinks” feature available in the latest ST for Windows, or only in future beta vesions? Thanks

Congrats again for this great project.

PS: I see @calmh mentioned in Option to follow directory junctions / symbolic links? - #134 by calmh that it is implemented, but when I tried to add a symlink to another directory (created with mklink /d ... ... on Windows) in a Shared folder, the other computer did not sync it.

This is a long thread. Despite the phrasing of the topic, the only thing that is implemented is following junction points. Symlinks are not followed and there are no plans to ever do so.

@calmh Thank you for your answer.

On Windows, I tried with a junction and it works now, if and only if I set <junctionsAsDirs>true</junctionsAsDirs>.

Minor drawback: any change in the directory which is linked with a junction is not automatically detected by the FSWatcher. I have to do a “Rescan all” in the GUI each time I want to sync the modifications inside the junctioned-directory to the remote computer.

Is this a known “in-progress” feature, or just a wrong configuration on my side?

Did you restart or pause/unpause the folder? That’s most likely needed, if it works at all. I wouldn’t be surprised if the system library for watching doesn’t automatically handle/follow junctions. And I have no intention to look into making it do so/add workarounds.

After further tests, I confirm that the automatic FS watcher (for new files/file changes) doesn’t look in the junctions directory by default on Windows, as of today (June 2022, ST 1.20.2)

We have to do either:

  • “Rescan all”

  • “Pause all” and “Resume all”

I don’t think that’s necessarily the case. I’ve just done a simple test, and Syncthing was able to automatically detect new files inside the junction with no issues.

Where does your junction point at specifically? Just in case it’s a drive root or somewhere similar, there’s a known issue about the watcher not working there.

Scrap the above. It only worked initially after creating the junction itself (and thus it scanned its subfolders too), but it doesn’t work anymore when doing file manipulations inside the junction.

1 Like

Please do something about this.

This not only causes the symlinks to stop syncthing, but all the rest of files.

It shall either ignore symlinks all together, or just code them into a special file with metadata. Nothing else.

But pausing just everything, it’s a big no no. The user may not realize that syncthing stopped working.

You mean like… a symlink? :grinning:

This shouldn’t happen. Can you post screenshots of the affected side?

Okay, now I see why.

Syncthing is also unable to sync files if their names contain :

Which is what is happening to me while building Arch Linux packages that contains not only pkgver but epoch, for example:

c++utilities-100:5.23.0-4-x86_64.pkg.tar.zst

Its nothing todo with syncthing, but with the filesystem that it’s being synced into. Thats an invalid character for some filesystems.