Why was FollowSymlinks removed?

I was recently resetting and updating all my nodes and noticed that Syncthing wasnt following my symlinks.

After Looking into the issue fether I found that on GitHub Issue 92 @Calmh said that FollowSymlinks was remoded becaouse:

it’s dangerous and messy, and was only a workaround for not having multiple repositories.

Could anyone explain what @Calmh ment by the above statement or why FollowSymlinks is a bad idea (and removed)?

Why don’t you just add multiple folders?

Symlinks are now synced as symlinks, hence if they are relative to their location, and both folders are relative to the same location, if would give you the same effect?

Alternatively, you can trick syncthing by doing bindmounts?

As for the reasons, there has been excessive discussion in the post to explain why it’s not a good idea.

Background Info: I have a Windows 8.1 desktop running Syncthing, and all the files are stored on a Mirrored “Storage Space” formatted to ReFS…

Most of the data 2.4TB of data on my “Storage Space” has been organized and I would like to keep it that way if possible. I mainly use Syncthing to sync sync commonly used files across my 2 desktop computers and laptop, and since my laptop has only a 60GB SSD I have to be picky about what I sync to it. So since I only “need” access to 10-20GB of the 2.4TB I would just simlink the the required files/folders so my organizational structure is not effected, and that way I would still have access to the needed information without syncing unneeded data.


Example: I have a Parent folder and a bunch of child folders.

Parent (X:\Parent)

  • Child1
  • Child2
  • Child3
  • Child4
  • Child5
  • Child6

Lets assume that I only need to sync Child2 and Child6, I have 4 options;

  • Point Syncthing to the Parent directory
  • Create a separate sync repository for both child folders (Child2 & Child6)
  • Create a folder called NewParent, then copy Child2 and Child6, and sync the newly created folder
  • Create a folder called NewParent, then make a symbolic link to Child2 and Child6, and sync the newly created folder

If I would only need to sync 2 different folders I would just create a separate repository for each folder since its not that much work, however when you need to sync 30 of the 60 children that nolonger becomes a sane option.

Currently my parent directory contains a little over 60 subfolders, 10 files, totalling around 15GB. Im in the process of adding additional subfolders and it will likely grow several fold in size. (200+ subfolders totalling over 40GBs)

  • Because of this I my second best option is to make copies of the data and sync that, but I’d prefer not because of the duplication of data and the changes wont be maid to back the original locations.
  • Normally normally sync the whole parent folder but since my the target computer has less then 60GB available that no longer is a compelling option. (Every GB matters on a small drive, never mind that the folder is going to grow in size)

I don’t know of any way to accomplish my task in a “clean” manner.

I have read the FAQ and before anyone says “HardLink!” according to several sources ReFS doesn’t have support for HardLinks.

Edit: How I originally setup Syncthing:

  • All my Syncthing files are kept in X:\Syncthing
  • Inside X:\Syncthing I have several folders and each of those are a repository that’s synced across multiple computers…
  • Lets say its called NewParrent (X:\Syncthing\NewParrent), and inside there is are 2 simlink folders (Child2 Child6)
  • Syncthing would follow the link (like I wanted) and on all the other computers it would just be a normal folder…
1 Like

You can use ignores to solve your problem:

!Child2
!Child6
*

on the device with little storage. This way you don’t even need access to the remote machine to create the symlinks.

I forgot about that, that would go into .stfolder correct?

So what does the above mean

* = everything
! = not?

In that case the code you provided would mean Sync Nothing, only sync Child2 and Child6

Does the order matter? In CSS if theres contradictory instructions the last instruction takes precedents.

Order does matter, and it doesn’t go into .stfolder.

Thank you @AudriusButkevicius, .stignore seams like it would do 99% of what I would use symlinks for.

Just out of curiosity does .stignore support single character ranges, in bash i would do somthing like;

  • [0-9] would by used to match a number number (one character)
  • [a,c-x,z] match only a, c through x and z (so not b or y)

In any case this solution solves my main issue and I should be able to get everything syncting properly again, Thanks again

All the patterns are explained in the Wiki. Though feel free to make a pull request supporting other patterns, or pure regular expressions if you wish.