File versioning only in a specific subfolder?

Can I configure Syncthing to version files only in a specific subfolder of a shared folder?

Example: I have a shared folder named “Documents”, with a contained subfolder “Scripts”. “Documents” is shared between my server and PC, but I only need file versioning on the “Scripts” subdirectory.

-Documents
--Scripts

Possible options:

  1. Could I share 2 folders from the server - “Documents” without file versioning and “Scripts” with versioning and then only accept the share of “Documents” on my PC? Would Syncthing recognize a change in “Scripts” and apply versioning?
  2. Same as above, but accept both shares on my PC?
  3. Do I need to separate “Scripts” from “Documents” on the file system?
  1. Documents would be the folder making the change, so no versioning. Next scan will show local file difference in Scripts, so no versioning either, as it is a local change.

  2. It depends which change is send first to the server. If Documents is scanned and send before Scripts the change is already made and no versioning.

  3. I think this would be the easiest.

I would try to solve this with external file versioning. The 2nd parameter will have the file path relative to the Syncthing folder. So if it starts with Scripts move it to version folder, if not delete it.

1 Like

Alternatively, split stuff up into more Syncthing folders. You should even keep the existing root folder with Scripts ignored, and then a separate folder with Scripts only.

1 Like

Great suggestions, thanks. I’ll take a look into the external file versioning for sure. It looks like it should be relatively trivial to setup a git repo in the scripts dir and have a script commit a new change when called from Syncthing.

Ignoring the Scripts directory in the Documents config is an easy fix which I’ll try also just to get some immediate versioning working.

Thanks for the ideas!

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