Rsync for Windows: Difference between revisions
From KlavoWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
# [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. | # [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. | ||
Line 9: | Line 9: | ||
The following example 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 | 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.
- 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. 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.
- 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.