Syncing only part of a text file

Being able to instruct Syncthing to sync only a portion of a text file might be a really nice feature.

Say, for example, you’re playing Minecraft across two devices, and you wanted to sync everything except the GUI scale and your keybinds. You could effectively just regex check for a line starting with “key.” that has an “=” somewhere in the same line, and a line starting with “scale=”, then blacklist those lines from syncing.

One way I could see a file like this being formatted is as follows:

# /path/to/file1.txt
123: Specific line of the file if it will stay constant.
R1: .*First regex match.*
R2: .*Second regex match\r\nWith carriage return and line feed support.*

# /path/to/file2.lua
1: --Would also support other file formats so long as they contain text.
R1: \-\-Regex could potentially match parts of other predefined lines if there's a concern that the line number may change, like if you think line 1 might be shifted down later, then you could match it with regex as well\.
R2: \-\-Would also support other file formats so long as they contain text\.

No, sorry.

1 Like

The workaround I would suggest for this use case would be to script the creation of the (truncated) file from the original file, and copy the new truncated file into a sync’d folder.