server for windows:
-----------------------
1.install cygwin setup.exe
2.install cygrunsrv #管理cygwin服务到windows。
3.为rsync建立专门windows用户rsyncuser,设置密码,加入administrators组。
vim /etc/rsyncd.conf
use chroot = false
strict modes = false
[test]
path = /cygdrive/d/source-data
comment = Rsync storage area
read only = false
4.add the rsyncd server to windows
server is win2k3:
cygrunsrv.exe -I "Rsync" -p /cygdrive/c/cygwin/bin/rsync.exe -a "--config=/cygdrive/c/cygwin/etc/rsyncd.conf --daemon --no-detach" -f "Rsync daemon service" -u Administrator -w password
server is NT/2K/XP:
cygrunsrv.exe -I "Rsync" -p /cygdrive/c/cygwin/bin/rsync.exe -a "--config=/cygdrive/c/cygwin/etc/rsyncd.conf --daemon --no-detach" -f "Rsync daemon service"
5. net start rsync
查看windows服务管理器,把rsync服务的登录用户设置为rsyncuser,重新启动服务。
client for windows(client for linux更好办):
---------------------------
1. vim c:\cygwin\secret
服务器上的rsyncuser密码
2.chmod 600 c:\cygwin\secret
3.vi d:/backup.bat
@cls
@echo off
rem Rsync job control file
C:\Cygwin\bin\rsync -vrtz --password-file=c:\cygwin\secret username@ip::test e:/desc-data
4.test.
5.把backup.bat添加到计划任务里即可。
阅读(1438) | 评论(0) | 转发(0) |