It would interest me how Syncthing treates the moving of files. Are the moved file also moved on the remote device? Or will the files be deleted in the old directory and re-uploaded to the new directory on the remote device
A move/rename should be handled as a rename on other devices as well. Technically what happens is that the update is sent as a pair of entries; one describing the new file, one saying that the other file has been deleted. We notice that the block checksums are identical and optimize it by “reusing” the file we were going to delete.
Moving files between folders (the Syncthing concept that has a label etc, not just directories on disk) is not optimized like this currently.
Well, but it potentially has a chance to copy the blocks across folders too, it all depends on the order of rescans of the two folders.
hi guys… In my example, syncthing deletes the files and uploads them again to my debian machine. I used drag&drop on my windows machine. should I use strgx&strgv? Could you clarify in which cases syncthing doensn’t simply move files? oO
In the cases when it sees the file removed before the new file added, which is very unlikely, or if it’s moving across folders, then it all depends on the order of rescans.
just had it with approx 370 files On my windows machine, I had a scan interval of 5 and on the debian machine 10. is maybe this “gap” responsible for this behaviour?
-bigfolder –lilfolder —music.mp3 was moved to: -bigfolder –music.mp3
Its not the scan interval between the machines, but between folders. Have you moved files in the same syncthing folder or across syncthing folders? (Not os folders)
I moved /bigfolder/lilfolder/music.mp3 to /bigfolder/music.mp3 bigfolder and all subfolders were synced while lilfolder is a subfolder of bigfolder…
So it’s within a single syncthing folder, correct? In that case files most likely got moved, it was just not obvious. They still show up in the out of sync list until the move happens. You can enable STTRACE=model and should see a bunch of taking rename shortcut log messages.
Trying to get my head around the behaviour of Syncthing.
A folder on PC (let’s call it d:\folder), synched to backup drive on attached to an RPI.
I move files around in subfolders of the PC (move a file from d:\folder\A to d:\folder\B)
After moving the file to B, the file appears back in folder A straight away. Result is the file is now in folder A and B.
It appears as if I’m no longer able to move files.
I assume I’m overlooking/misunderstanding something. Just not clear to me what.
This very old topic isn’t really the right place to write about a current issue, but are you running v1.22.0 by any chance? If yes, then this kind of file “undelete” behaviour on move/rename looks like the bug that I experienced in https://forum.syncthing.net/t/keep-getting-conflicts-generated-on-android-device-for-files-modified-only-on-a-desktop-pc/19060. The fix is available in the current RC, so if that’s indeed the culprit, then you should either enable upgrading to release candidates, or wait for the next stable version sometime in the beginning of November.
I’m indeed running v1.22 on both sides (Win and Raspbian).
An awful regression compared to v1.21 so it seems.
Looking forward to see this resolved in the next release.