Backing up a Windows machine using Cygwin rsync WITHOUT ssh
This setup was tested with Win2k, NT4.0 and cygwin rsync version 2.6.3 version 28.
Before you can use Rsync on a Windows Workstation or Windows Server, you will need to download and install the Cygwin system http://www.cygwin.com, with the following selections as a minimum:
This example assume an installation in [=c:\cygwin\] directory.
After the preliminary questions, choose the following minimum packages:
Expand the +Admin section
Select cygrunsrv NT/W2k service initiator.
Cygwin Editors Selection
Click +Editors to expand the choices, then select nano.
Cygwin Net Selection
Click +Net to expand the choices, then select Rsync.
Open the Control Panel and double click on the System applet. Click on the Advanced tab, then click the Environment Variables button. Double click on the PATH statement in the 'System Variable' screen (lower of the two), add the path on the end [=c:\cygwin\bin], and click OK . Click OK to close the Environment Variables screen, then click OK to close the System Properties dialogue box. The path will be dynamically reloaded.
This section was derived from http://www.gaztronics.net/rsync.php and http://pigtail.net/LRP/printsrv/cygwin-ssh.html
Client Files
Now create the [=rsyncd.conf] and [=rsyncd.secrets] files as the examples bellow to [=c:\cygwin\etc\].
These files need to be present on the Windows machine.
/etc/rsyncd.conf alias c :\cygwin\etc\rsyncd.conf
Note: You need to change 192.168.0.253 to be the address of your dirvish server. You could also use a hostname, or use a subnet (192.168.0.0/24, for example.) This line restricts what machines can access the share.
You can also change [=path=] to just be a specific directory (e.g., [=c:\documents\] would be [=path=/cygdrive/c/documents/])
gid = users read only = true use chroot = false transfer logging = false log file = /var/log/rsyncd.log log format = %h %o %f %l %b hosts allow = 192.168.0.253 hosts deny = 0.0.0.0/0 strict modes = false [drive-c] path = /cygdrive/c/ auth users = backupoper secrets file = /etc/rsyncd.secrets
/etc/rsyncd.secrets alias c :\cygwin\etc\rsyncd.secrets
Change [=mypassword] to a better password, of course.
The file must have a CR after the password.
backupoper:mypassword
Now *install the rsync service* with the following command:
cygrunsrv -I "RSYNC" -d "Rsync daemon" -p /usr/bin/rsync.exe -a "--config=/etc/rsyncd.conf --daemon --no-detach" -f "Fast incremental file transfer"
The rsync service is now installed. You can start it with
cygrunsrv --start rsync
And stop it with
cygrunsrv --stop rsync
Server Files
These files are for the dirvish server.
default.conf
Your default.conf file for the windows machine will look like:
client: backupoper@<winmachine> password-file: /etc/dirvish/winmachine.passwd tree: :drive-c ... rest of file ...
(with any additional site-wide preferences you have.) Note the leading colon on the [=tree:] line. [=:drive-c] means use the [=drive-c] share on the Windows rsyncd server. We define [=drive-c] in our client-side [=rsyncd.conf] file to point to the c:\ directory.
Note: If you have multiple windows machines and don't want to have the same password on each, you may need a separate /etc/dirvish/win.password file. In that case, you may want to store the password file in the same directory as your [=default.conf] file. Adjust the config above as needed.
/etc/dirvish/winmachine.passwd
This should match the password in rsyncd.secrets. make sure the copy on your dirvish machine has permissions of [=600].
- mypassword
This page was derived from WinRsyncd by Jason Cater
Antonio Cardoso Martins - August 2005
