rsync from Linux to Windows over SSH
9,205
I ended up installing cygwin, and made sure to also install the rsync
package. Then, I modified my PATH
environment variable to include cygwin's bin
directory. I was then able to call rsync
from powershell, to confirm the installation worked.
After that, I was able to successfully use rsync
on my Linux machine to transfer files to the Windows machine.
Related videos on Youtube
Author by
surj
Updated on September 18, 2022Comments
-
surj over 1 year
Right now, I'm using SCP to copy directories from a Linux Server to a Windows 10 box. I'd like to use something like
rsync
instead, since the directory is fairly big and only a couple files change.I have powershell running as the default shell when I SSH into the Windows box, if that makes a difference.
-
Christoph Sommer about 5 yearsWhat is your question? What have you tried? What would you need to know to consider the question solved?
-
dirkt about 5 yearsSo you need to install one of the rsync implementations for Windows on the Windows box, and then you rsync either over the native rsync protocol, or over ssh (google "rsync over ssh"). Have you tried that? What worked, what didn't work?
-
-
ankit7540 over 3 yearsCould you elaborate about modifying the
PATH
variable and using powershell to callrsync
installed on cygwin. Thanks. -
surj over 3 years@ankit7540, I installed cygwin (and selected
rsync
for install). Next, I located thebin
directory of cygwin. I believe the defaultbin
directory of cygwin is underc:\cygwin\bin
. I added thebin
folder location to myPATH
environment variable. Then, I opened up powershell, typedrsync
, and the program opened up, which means thePATH
change worked and all was good. Maybe this link will help you: superuser.com/questions/27668/… -
ankit7540 over 3 yearsThanks for the description.
-
user3751385 over 2 yearsAfter completing the instructions above, also be sure to restart the ssh server on Windows. That can be done by running
services.msc
in the command prompt, scrolling tosshd
, righ-clicking and selectingrestart
. -
user3751385 over 2 yearsAlso note that you'll want to prepend
/cgydrive
to the source filepath like so:rsync -chavzP --stats user@ip:/cygdrive/c/source/dir /target/dir