[question] hardlinked files between sync/subfolders

I read the documentation and 2 topics here, I believe I understand the limitations, just want to confirm the expected behaviour is correct:

Imagine Sync is my Syncthing folder, being synced between Ubuntu, a desktop PC and a laptop (that’s all).

Sync contains multiple folders, of particular interest is the folder doc:

PC:Sync/docs/{subfolders and files}

This folder can contain a lot of folders with lots of 3-12MB images and drawings. People can delete them all the time. We need an archive of everything. Therefore: On the Desktop pc, a script is running. It creates subfolders and hardlinks files for everything inside Sync/doc/.. to:

Sync/archive/{subfolders and hardlinked files of doc}

What will now happen at the peer side, the laptop?

Will the Laptop:Sync/archive folder simply contain all files, no hardlinks of PC:Sync/archive ?

I believe so. Would be unfortunate as my laptop space is limited and the team can put lots of files in PC:Sync/doc.

Is there anyway to prevent this (taking up all that space on my laptop) from happening?

I don’t actually understand the scenario and the question. However you might be able to reason about it from first principles - Syncthing doesn’t see or care about hard links, it just sees individual files. When a change is synced it’s first written to a temp file, then renamed in place over the original, removing any “sharing” you might have had via hard links.

Ok, the scenario is simple. There are hardlinks in the synced folder, those hardlinks link to files that are also in the synced folder (just a different subfolder).

The question is, on the peer side, will the hardlinks appear as separate files? This means the Sync folder on the peer side will always take up more space than on the server side.

I am just trying to figure out how to solve this. One way would be to exclude the path to the folder containing hardlinks so that this folder does not get synced at all.

Syncthing doesn’t see hardlinks, it sees files, so your hardlinks will turn into normal files on the other side.

Yes the simplest solution in my case is to just add one of those 2 folders to my ignore pattern. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.