Issue running rsync from windows server 2016 to windows server 2016

rsyncwindows-server-2016

I'm trying without success to copy files from one windows host to another using either cygwin or powershell and the rsync.exe. On the windows host I want to send the copy I have openssh installed, I can telnet on 22 to it, and can send files to it via scp. But, when I try to copy files to it from either a windows or linux machine, I get the following error:

'rsync' is not recognized as an internal or external command,
operable program or batch file.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(235) [sender=3.1.1]

This is the command I use to copy from powershell:

.\rsync.exe -avzh --stats -P -e C:\Users\Administrator\Desktop\rsync\ssh.exe rs
ync.html 'administrator@ip:C:\\'

When I run the same command, but try to copy to a CentOS 7 machine, I only change administrator@ip:C:\\ to root@ip:/root/ and it works.

If you have any idea what the issue could be, or you need any other info, please let me know.

Best Answer

Unfortunately I cannot answer your question directly however can give you a just as good workaround, in my experience, while Cygwin can give you a good platform to be able to use Linux commands on windows. Keep in mind windows is not Linux.

Most Linux commands have a windows counterpart, yes some are not one-liners, however have you looked at robocopy?

Robocopy - https://en.wikipedia.org/wiki/Robocopy

Comes installed and can be used with powershell.

Related Topic