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
Thanks a lot you are always supper helpful
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?
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.
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:/