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.

Share:
9,205

Related videos on Youtube

surj
Author by

surj

Updated on September 18, 2022

Comments

  • surj
    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
      Christoph Sommer about 5 years
      What is your question? What have you tried? What would you need to know to consider the question solved?
    • dirkt
      dirkt about 5 years
      So 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
    ankit7540 over 3 years
    Could you elaborate about modifying the PATH variable and using powershell to call rsync installed on cygwin. Thanks.
  • surj
    surj over 3 years
    @ankit7540, I installed cygwin (and selected rsync for install). Next, I located the bin directory of cygwin. I believe the default bin directory of cygwin is under c:\cygwin\bin. I added the bin folder location to my PATH environment variable. Then, I opened up powershell, typed rsync, and the program opened up, which means the PATH change worked and all was good. Maybe this link will help you: superuser.com/questions/27668/…
  • ankit7540
    ankit7540 over 3 years
    Thanks for the description.
  • user3751385
    user3751385 over 2 years
    After 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 to sshd, righ-clicking and selecting restart.
  • user3751385
    user3751385 over 2 years
    Also 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