rsync使Linux客户端同步windwos服务器文件

WIN2008服务器上的RSYNC.CONF文件配置

RSYNC.CONF 中内容:

UID = 0

GID = 0

use chroot = false

strict modes = false

hosts allow = *

log file = rsyncd.log

max connections=30

lock file=rsyncd.lock

# Module definitions

# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work

#

[webroot]

path = /cygdrive/d/webroot

read only = false

transfer logging = yes

[2010Res]

path = /cygdrive/d/webroot/2010/StaticFile/TC.Web.Static

read only = false

transfer logging = yes

[2009Res]

path = /cygdrive/d/webroot/2009/TC.Static

read only = false

transfer logging = yes

linux 客户端设置

rsync -avr --compress --ignore-errors --force --delete 10.0.0.100::2010Res /tcweb/XXX/2010

rsync -avr --compress --ignore-errors --force --delete 10.0.0.200::2009Res /tcweb/XXX/2009

chmod -R 755 /tcweb

2010/StaticFile是webroot的下一级

Linux客户端写成shell

[root@localhost Desktop]# vi rsync.sh

#!/bin/bash

rsync -avr --compress --ignore-errors --force --delete 10.0.0.100::2010Res /tcweb/XXX/2010

rsync -avr --compress --ignore-errors --force --delete 10.0.0.200::2009Res /tcweb/XXX/2009

chmod -R 755 /tcweb

sh /rsync.sh 时时同步循环执行

[root@localhost Desktop]# chmod a+x rsync.sh

[root@localhost Desktop]#./ rsync.sh

你可能感兴趣的:(linux,rsync,Windwos,客户端同步,服务器文件)