Move file to sub folder. the other computer dont make MOVE action?


(Hansi) #1

A’PC:move a large file to sub folder. B’PC:delete the file from old location, and sync a new file from new location of A’PC.

i think B should do MOVE action, but it don’t.

cut and patse in the same parttion would save lot of time. but delete and sync new will takes long .

Am I missing some important setting? Or, it designed to do this?


#2

Normally, Syncthing will move the file on B.

On A, Syncthing doesn’t see the move, but it sees that the original file is gone, and an new file with the same hash is somewhere else. But for some reason it seems that in your situation, the delete was synced before the “new” file, so B deleted the original file before wanting the “new” file.


(Hansi) #3

BUT, How can I make delete was synced after the “new” file? I have tried different MOVE, sub folder, parent folder, new folder…it always do “Del and New” in every time.


(Simon) #4

Are source and destination directory in the same Syncthing folder (i.e. below the root path of the same shared folder)?


(Hansi) #5

Very Sure! All the action i did under the share folder. but both of them are windows, so no root things.


(Audrius Butkevicius) #6

If it’s a lot of files, that’s going to happen, as we can’t send all the changes in a single message, and syncthing starts working on stuff as soon as it gets a single message, which means that deletes can happen before creates (which means we’d fail to recognize renames).

Best bet is to copy, wait to get in sync, and delete.


(Hansi) #7

I just move only ONE large video file which is about 700MB from a folder to another. only one file. Is it possible have some different code between windows version and linux version? it’s really hard to know why.


(Audrius Butkevicius) #8

It’s the same version between the two, but there are edge cases where moves will not be recognized.


(Hansi) #9

In my case, There are always delete and add action in Global Changes list. how many type of action could be in Global Changes List ?


(Audrius Butkevicius) #10

What order is it in? It could be that the addition is large enough to require it’s own message, so the delete gets split.

Also, could you call https://docs.syncthing.net/rest/db-file-get.html on the source for both the old file name and the new file name?


(Hansi) #11

Did I type it right?


(Audrius Butkevicius) #12

You didn’t specify the folder, and I am not sure it’s the full path.


(Hansi) #13

I typed the full path. it still shows “no such object in the index”…

PLEASE give me an example.

if i move c:\a.iso to c:\sub\a.iso. what should I execute?


(Audrius Butkevicius) #14

Have you actually specified the folder ID? The path should be relative path to the folder root. If your folder is at c:\foo\bar, and file is at c:\foo\bar\baz\nuff\some.iso, then the path should be /baz/nuff/some.iso.


(Hansi) #15

Give me a example please. i think i mess up the quote mark & “/” & “” …confuse

A’s PC

image

B’s PC

and now! I’m gonna move the file from

D:\Sync_HTPC\share\CWP-152.mp4 to D:\Sync_HTPC\share\ARTS\CWP-152.mp4

using A'PC. What should I type in the shell? now it’s clear.


(Audrius Butkevicius) #16

I’ve explained above how you compose a path, you are also missing folder= in the URL as explained in the docs. Anyways, moving it again might not reproduce the issue, hence you should do it on the old file name.


(Simon) #17

Be sure to use quotation marks around the URL as shown in this example, to be sure the shell does not interpret & or ?:

curl -X POST -H "X-API-Key: yourkey" "http://localhost:8384/rest/db/file?folder=htpc-hansi281&file=share/CWP-152.mp4"


(Hansi) #18

i got this:

{
   "availability":null,
   "global":{
      "deleted":true,
      "invalid":false,
      "modified":"2017-01-18T15:51:47.2426086+08:00",
      "name":"share\\CWP-152.mp4",
      "noPermissions":false,
      "numBlocks":0,
      "permissions":"0",
      "sequence":519,
      "size":0,
      "type":0,
      "version":[
         "DCXM6JU:1",
         "K3A56YQ:1"
      ]
   },
   "local":{
      "deleted":true,
      "invalid":false,
      "modified":"2017-01-18T15:51:47.2426086+08:00",
      "name":"share\\CWP-152.mp4",
      "noPermissions":false,
      "numBlocks":0,
      "permissions":"0",
      "sequence":519,
      "size":0,
      "type":0,
      "version":[
         "DCXM6JU:1",
         "K3A56YQ:1"
      ]
   }
}

(Hansi) #19

the method should be GET. thank a lot lot lot !!!


(Audrius Butkevicius) #20

I am interested in both, the old file and the new file on the origin where the rename happened, when you are actually sure it had to be redownloaded. It’s not clear if this new file had the same side effect.