How to sync a read only folder?

Hi

I would like to sync a readonly folder (mounted backups) one way to another pc. I know how to create a one way sync. My issue is about Syncthing needing to create the .stfiles and .stfolders files there, naturally it cant do that since it is read only.

I am trying to sync a folder in /mnt/SYNCFOLDER (Linux)

Any recommendations to handle this case?

thanks

Two options come to mind:

  • If possible, temporarily mount the folder as read-write and add .stfolder (it’s a folder, not a file) manually. That’s the only file/folder required for operation. Once that folder exists, the thing can go back to read-only.
  • Otherwise, if you have a file or folder that you know will always exist, you can manually configure syncthing to use that file/folder. (Set Marker Name for that folder in Syncthing’s advanced (folder) options)

Also, since you’re working with read-only stuff, syncthings folder type send-only makes sense to prevent write errors, if you aren’t using that already.

1 Like

Hi

Thanks for the reply.

I cannot sneak in those files in there because the folders are generated byu the app in user space. So that is not an option.

I will try the Marker name solutions. Do I need to put a full folder path in there?

EDIT: I tried both /FULLPATH and /FULLPATH/.stfolder but it still complaints about not findind the folder marker.

I think the path is relative to the root of the folder and you do not need to use a slash in the beginning. Example:

  • Syncthing folder foo located at /home/user/foo
  • Marker folder/file located at /home/user/foo/bar/marker
  • Syncthing’s marker name would be bar/marker

(I haven’t actually verified if the above is true, this is only what my software instincts tell me)

PS: It might make sense to choose a folder/file in the root of the syncthing folder (in the example above that would be bar), as I’m not sure if markers in subdirectories are well-supported.

3 Likes

Thanks, I made it work with your guidance. I know some files always exists there like metadata about the backups, so I pointed at that file and now it is scanning.

Thanks for the help

1 Like

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