rsyncd.conf:
# sample rsyncd.conf configuration file
# GLOBAL OPTIONS
#每次连接输出给客户端的信息
#motd file=/etc/motd
# for pid file, do not use /var/run/rsync.pid if
# you are going to run rsync out of the init.d script.
pid file=/var/run/rsyncd.pid
syslog facility=daemon
#socket options=
# MODULE OPTIONS
#需同步的模块,可以有多个
[yougotit]
#客户端list时,显示的模块说明信息
comment = public archive
#此模块所在的路径
path = /root/wdc/progamsuse chroot = no
# max connections=10
lock file = /var/lock/rsyncd
# the default for read only is yes...
read only = yes
list = yes
#该选项指定当该模块传输文件时守护进程应该具有的uid
uid = rootgid = root
# exclude =
# exclude from =
# include =
# include from =
auth users = wdc root
#secrets file 文件内 一个条目一行 user:password
secrets file = /etc/rsyncd.secrets
#严格模式,要求secrets file的mode 为 只能被rsync服务器运行身份的用户访问,其他任何用户不可以访问该文件, 一般为0600
strict modes = yes
#当hosts allow和hosts deny对某一ip都设置时,allow优先
hosts allow = 192.168.137.2# hosts deny = 192.168.137.2
ignore errors = no
ignore nonreadable = yes
transfer logging = no
# log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
timeout = 600
refuse options = checksum dry-run
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
daemon方式启动rsync: rsync --daemon
配置好后的使用方式:
rsync -av root@192.168.137.2::yougotit/trie ./test/
将192.168.137.2里同步目录下的trie同步到本地test下