Rsync for Windows: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
To allow you to copy data from Windows to a Linux computer using rsync.
To allow you to copy data from Windows to a Linux computer using rsync.


# [http://sourceforge.net/projects/sereds/files/ Download] and install the appliction.  The version that was avaiable at the time I used was 3.1.0.
# [http://sourceforge.net/projects/sereds/files/ Download] and install the application.  The version that was available at the time I used was 3.1.0.
# Once the file has been downloaded and installed add the path C:\Program Files\cwRsync\bin to your environment variable.
# Once the file has been downloaded and installed add the path C:\Program Files\cwRsync\bin to your environment variable. Also add the environmental variable HOME=Users\username
# run '''ssh-keygen -t rsa''' to generate a public key that you can copy to the Linux box that you want to use rsync with.  The location of the created public key is '''%USERPROFILE%\.ssh\id_rsa.pub'''.
# run '''ssh-keygen -t rsa''' to generate a public key that you can copy to the Linux box that you want to use rsync with.  The location of the created public key is '''%USERPROFILE%\.ssh\id_rsa.pub'''.
# Once the public key has been uploaded (or merged if it already exists) to the Linux file '''~/.ssh/authorized_keys''' you will be able to copy files between the two servers without the need for authentication.
# Once the public key has been uploaded (or merged if it already exists) to the Linux file '''~/.ssh/authorized_keys''' you will be able to copy files between the two servers without the need for authentication.


To start copying files with rsync on the Windows computer use the following command.<br>
To start copying files with rsync on the Windows computer use the following command.<br>
The following examples is copying files from C:\Data\Files to the linux box /usr/src.
The following example is copying files from C:\Data\Files to the linux box /usr/src.
<pre>
<pre>
rsync -avrzh --progress /cygdrive/c/Data/Files klaverst@klaverstyn.com.au:/usr/src/
rsync -avrzh --progress /cygdrive/c/Data/Files username@myserver.com:/usr/src/
</pre>
</pre>


If your path has spacec wrap the path with commas. EG
If your path has spaces wrap the path with commas. EG
<pre>
<pre>
rsync -avrzh --progress "/cygdrive/c/Data/Files" klaverst@klaverstyn.com.au:"/usr/src/"
rsync -avrzh --progress "/cygdrive/c/Data/Files" username@myserver.com:"/usr/src/"
</pre>
</pre>



Latest revision as of 02:27, 26 May 2011

To allow you to copy data from Windows to a Linux computer using rsync.

  1. Download and install the application. The version that was available at the time I used was 3.1.0.
  2. Once the file has been downloaded and installed add the path C:\Program Files\cwRsync\bin to your environment variable. Also add the environmental variable HOME=Users\username
  3. run ssh-keygen -t rsa to generate a public key that you can copy to the Linux box that you want to use rsync with. The location of the created public key is %USERPROFILE%\.ssh\id_rsa.pub.
  4. Once the public key has been uploaded (or merged if it already exists) to the Linux file ~/.ssh/authorized_keys you will be able to copy files between the two servers without the need for authentication.

To start copying files with rsync on the Windows computer use the following command.
The following example is copying files from C:\Data\Files to the linux box /usr/src.

rsync -avrzh --progress /cygdrive/c/Data/Files username@myserver.com:/usr/src/

If your path has spaces wrap the path with commas. EG

rsync -avrzh --progress "/cygdrive/c/Data/Files" username@myserver.com:"/usr/src/"

If you are using batch files or automated processes don't use the --progress switch.