Transferring from Windows to Linux with rsync

andrewk picture andrewk · Nov 15, 2010 · Viewed 20.1k times · Source

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 [email protected]:/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 [email protected]:/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?

Answer

paxdiablo picture paxdiablo · Nov 15, 2010

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