Search code examples
windowslinuxrsynctransfer

Transferring from Windows to Linux with rsync


noob here,

I'm trying to transfer a file using rsync from windows to linux. I have this code, but I'm getting an error

rsync -avz -e ssh C:\users\file.txt root@123.45.67.89:/var/dir

I get this error The source and destination cannot be both remote

And if I try

rsync -avz -e ssh /c/users/file.txt root@123.45.67.89:/var/dir

I get, No such file or directory

So, I think the problem is with the path of the file on the windows.. I've heard about cygwin but haven't really tried it

What can I do to get the path to work?


Solution

  • If you're using CygWin to rsync from the Windows box, the local file you want is almost certainly:

    /cygdrive/c/users/file.txt
    

    rather then:

    /c/users/file.txt