1

I'm new to rsync and need some help with syntax or common understanding.

I have 3 servers:

  1. Source (SRC)

  2. Destination (DST)

  3. Server where rsync and ssh are installed.

I use rsync from Cygwin

Note: SRC and DST do not have rsync installed. All 3 servers run Windows 2012 R2.

My goal: I need to copy/sync folder X located on SRC e.g. C:\Program Files\X to DST at the same location.

I run this command:

rsync -a \\SRC_server\Program Files\X \\DST_server\Program Files\X

I've got the error that it failed to recognize the path.

Note: The server where rsync is installed could see and write to SRC and DST i.e. I could access and write to remote servers.

My questions:

  1. Should I install rsync and ssh to SRC and DST as well?
  2. What is wrong with the syntax of my command?

I want a simple copy/sync option and I'll optimize it later. Right now I can't even copy files from SRC to DST so I'd like to see if someone can help me get this resolved.

6
  • susik - Try using \\ between the file file path like C:\\Program Files\\X or else use forward slashes in place of the single backslash e.g. C:/Program Files/X... I wasn't able to get to the Server 2012 machine remotely to test the other thing for you but hopefully I'll be able to get my remote access to it re-established tomorrow and get some time to test the WSB as I told you I would. If you happen to determine that rsync solves that problem with the millions of files or whatever though, that'd be great news!! Commented Jul 9, 2018 at 3:15
  • For a built-in automated backup solution on Windows, you could use robocopy and Windows Task Scheduler with a batch file. (Since all of the listed servers run Windows, why shoe-horn a Linux-based solution into the mix?)
    – user228546
    Commented Oct 11, 2018 at 20:51
  • Wouldn't robocopy be a better solution than rsync considering it's a native program and does everything required, including syncing directory content in real-time based upon an arbitrary number of changes (1 is the minimum) that can be specified? See RoboCopy /?
    – JW0914
    Commented Dec 23, 2019 at 5:45
  • Backslashes as path separators are for sure incorrect under Cygwin. You need to use forward slashes. Another problem is that some of your directories are using spaces in the names, but you don't quote the argument. No wonder that the path is not recognized. Commented Dec 28, 2021 at 11:10
  • Please read this to learn how a file is referenced in the file system. While this article is written with Linux in mind, it applies in the same way to Cygwin as well. BTW, with this type of question, it is also a good idea to tag it with the shell you are using. Commented Dec 28, 2021 at 11:12

1 Answer 1

0

Well thanks for support but our team decided to refrain from using sync. We still consider 2 options: 1. Backup/Restore using WSB or 2. Still play with tar or even zip utility But change the workflow. I think that network latency is the culprit in my case. Hence I am going to follow tar/copy/untar steps but instead of doing it remotely I will tar locally. I hope it might make the difference. Hence this rsync ticket could be closed as immaterial anymore. Thanks

2
  • In case you still need it: I also have the problem of the slow network and was about to drop Cygwin's rsync, until a colleague pointed out to me the use of the -z option. This causes the files to be zipped before transfer and makes the whole process considerably faster. Commented Apr 29, 2022 at 5:52
  • Not specifically zipped, @user1934428, but definitely compressed. Commented Jan 19 at 19:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .