Rsync to copy local and remote folders

I am trying to copy a directory with files and folders to another directory, first locally for testing, and then to a remote server. A tool that I should use, rsyncbut after a lot of testing and reading documents, I can’t get it to work under Windows 7.

For example, when I try

rsync -av D:\source\ D:\dest\

I get an error The source and destination cannot both be remote.

When I try rysnc -av \source\ D:\dest\, I getError: Failed to exec ssh: No such file or directory (2)

Do you know how I can make it work?

Thank.

+5
source share
2 answers

Cygwin's paths are different to make them Unix-like. Use

rsync -av /cygdrive/d/source/ /cygdrive/d/dest/ 

D: interpreted as a remote server called D

+6
source

Gravedigger , -

Windows 8.1 , Windows 7 . -

- C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.6.3\plugins\synced_folders\rsync\helper.rb

cygdrive , -

    if Vagrant::Util::Platform.windows?
      # rsync for Windows expects cygwin style paths, always.
      # Editing source is never fun, but it works : /
      hostpath = "/cygdrive" + Vagrant::Util::Platform.cygwin_path(hostpath)
    end
0

All Articles