I am trying to sync a folder on Backblaze B2 but have run into a problem. ST always creates an empty directory .stfolder on any synced folder. This folder is created OK initially but is deleted leading to ST stopping and complaining that the index file is missing. This can then lead to all the data being deleted on a remote syncing to this folder.
Has anyone successfully connected Backblaze B2 to ST?
The setup I have is an AWS Debian instance with Backblaze mounted with rclone+fuse and ST v1.20.2
You can just create some dummy file inside that folder, named whatever you like. That should usually prevent those auto-cleanup mechanisms from removing it.
Have you actually experienced any data being deleted because of this? Because the reason for having the folder marker is to prevent exactly that. If itâs missing, no changes will be picked up or synced anymore.
Sorry I just realized that Backblaze is some kind of cloud storage, which apparently youâre mounting via FUSE. Who is actually removing the empty .stfolder then? If Backblaze is adding a dummy file itself, then theyâre probably not to blame for it getting removed.
What exactly is the error message? Is the index file missing, or does it say the marker is missing?
Yes, Backblaze B2 is a cloud storage service mounted by FUSE The error message is that âfolder markerâ is missing. B2 has no notion of directory. Thatâs why they put the .bzEmpty there.
You can create a .bzEmpty there too if you like, or .stfolder can be a file instead of a directory, or you can configure Syncthing to look for another file than .stfolder.
Thanks. I hadnât realised that .stfolder could be a file or a folder. Am I right that ST by default attempts to create .stfolder as a folder in any folder that is selected for sync?
Is there a setup option that allows .stfolder creation as a file to be configured?
The solution seems to be to manually put a file .stfolder on each folder that is to be added to ST. Any .stfolder folder there already should be deleted. In addition, B2 bucket must be configured to NOT save file versions or this confuses ST. I had to run ârclone cleanupâ on the B2 bucket several times to clean out all the old versions of files. It seems to be syncing correctly at the moment.
I was premature in thinking that itâs working OK. I found that when a file is modified, ST creates a .syncthing.file.tmp file on B2 which is a zero byte file. B2 creates multiple versions of this even though the bucket is configured to keep only the latest version. Syncing is now stalled with the file showing out of sync. âRclone cleanupâ doesnât delete the old versions so it looks like ST is continually writing this file as it attemps to sync.
Yes, I agree. I found out from B2 that there is no setting to allow one-only file copies. Thus ST will keep creating new files and these will be accumulated until B2 runs its 24hr cleanup cycle. I guess ST has no mechanism for cleaning up these duplicates as it goes.
So it seems that itâs pretty much game over for trying to sync out from B2.
Are you aware of any other cloud storage that is useable with ST?