Rclone rc sync/copy does not copy file

Trying to copy a single file using rclone rc sync/copy command. But it returns with error saying

500 Internal server error: "error": "is a file not a directory"

However using normal rclone copy command I am able to do that.
Is this a bug, is there a workaround for this?

we need the exact command that is giving you the error?

Thanks for the prompt reply
Here is the command

rclone rc sync/copy srcFs=C:/Users/[user]/Desktop/a.txt dstFs=loc2:C:/Users/[user]/Desktop/newfolder --rc-addr=ip:port --rc-user=[user] --rc-pass=[pass]
2019/11/09 21:22:43 Failed to rc: Failed to read rc response: 500 Internal Server Error: {
"error": "is a file not a directory",
"input": {
"dstFs": "loc2:C:/Users/[user]/Desktop/newfolder",
"srcFs": "C:/Users/[user]/Desktop/a.txt"
"path": "sync/copy",
"status": 500

If you want to copy a file, you'll need to use sync/copyto. sync/copy only copies directories unlike rclone copy which has a special case for files in. This is to make the API more regular.

Hi ncw
I have already tried copyto. It says "error": "couldn't find method \"sync/copyto\""

rclone rc sync/copyto srcFs=C:/Users/[user]/Desktop/a.txt dstFs=loc2:C:/Users/[user]/Desktop/newfolder --rc-addr=ip:port --rc-user=[user] --rc-pass=[pass]

Sorry that should be operations/copyfile.

1 Like

Hi ncw
Thanks a lot you are always supper helpful :wink:
I just notice for windows directory I need to add '/' after remote name and removing C:/.
rclone rc operations/copyfile srcFs=loc2:/ srcRemote=Users/[user]/Desktop/a.txt dstFs=loc2:/ dstRemote=Users/[user]/Desktop/a.txt --rc-addr=ip:port --rc-user=[user] --rc-pass=[pass]

Just last question as I my code will send the rclone rc command to both windows and linux servers, is it safe to keep extra '/' after the remote name for both linux and windows directories. i.e. srcFs=loc2:/

It should be safe for windows and linux. Is it just the C:\ case it gets confused for windows? I'm not sure really why that is - what error message to you get?

Situation 1: Error
srcFs=loc2: srcRemote=C:/Users/user/Desktop/filename returns 404 not found

Situation 2: Error
srcFs=loc2: srcRemote=Users/user/Desktop/filename returns 404 not found

Situation 3: Error
srcFs=loc2:/ srcRemote=C:/Users/user/Desktop/filename returns:
500 Internal Server Error: { "error": "CreateFile \\C:\\Users\\user\\Desktop\\filename: The filename, directory name, or volume label syntax is incorrect."

Situation 4: Working
srcFs=loc2:/ srcRemote=Users/user/Desktop/filename is working as expected

Situation 5: Working
srcFs=loc2: srcRemote=Desktop/filename is working as expected (rclone rcd command is running from C:\Users\user>rclone rcd..... )

Thanks for listing those out.

You shouldn't need to make a remote - a path will make it use that directory as root.

An empty string means use the current directory

srcFs= : srcRemote=/Desktop/filename

This works too

srcFs=C:/ : srcRemote=Users/user/Desktop/filename

The problem is that rclone is expecting "rclone paths" in the remote control syntax which is why your example 3 doesn't work - rclone will be making /C:/Users/user/Desktop/filename out of that.

Thanks for explaining :slightly_smiling_face:

Empty string returned with 500 error saying did not find section in config file for both windows and linux server. So I removed the ':' and changed it to srcFs=" " this time got 404 not found error

However, the second one (quote below) worked only after removing ' :'. i.e. instead of srcFs="C:/ :" I wrote srcFs=C:/

Sorry what I wrote was a typo, it should have been srcFs= or srcFs="" !

1 Like

Yes it worked. I should have tried it myself as you already said 'Empty string' :wink:

1 Like

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