How to set temporary files location?


I’m trying to use Syncthing on a server with mounted Openstack Swift Object Storage using FUSE driver from OVH

“Normal” files are working OK when I put them manually they are synced from server to my desktop PC.

The problem is in opposite direction - Syncthing is creating temporary files and it’s probably trying to lock them or to do other kind of file operation that is not supported using object storage resulting in errors like:

opening temp file: open /home/user1/Sync/.syncthing.test1.pdf.tmp: operation not supported

Is it possible to set different temporary files location so it could use regular ext4 volume only for temp, while keep synced files on mounted object storage folder?

It’s not possible to change the temp file directory. Specifically, Syncthing must be able to rename the temp file into the final destination, which means they must be on the same volume.

(I’m not sure why the open fails as in your case.)

If you are technical enough, you could create a custom filesystem backend in syncthing to properly support this.

Being that technical though I think it would be better to figure out why our open fails. Otherwise, in the end we’ll have to copy the file back to the odd object storage volume and anyway run into the same problem again. The problem is with Syncthing trying to create a file there, not that it’s a temporary one (probably, unless it’s the name it opposes.)

Jakob & Audrius, thanks for your fast reply

Any ideas how can I get more information about what type of file operation is causing this problem?

I checked and Syncthing has full R/W access to that directory.

Do I need do strace that or there is some option to increase logging verbosity?

It’s this line:

So it most likely does not support exclusive or create flags (see code above), hence not posix compliant, hence does not work.

Any idea what will happen if I’ll modify create flags to disable exclusive access to the opened temp file?

Is there any probable data loss scenario involved if no other process will ever try to access that temp file?