标签:
#rpm -qa | grep rsync rsync-2.5.7-5.3E #ls /etc/xinetd.d/rsync /etc/xinetd.d/rsync
2,主要是更改rsyncd.conf和 rsync这两个文件
#mkdir /etc/rsyncd #cd /etc/rsyncd #ls
rsyncd.conf #主配置文件
rsyncd.motd #banner消息
rsyncd.secrets #里面的内容用户名:密码pid file = /var/run/rsyncd.pid port = 873 address = 服务器IP uid = root gid = root use chroot = yes read only = yes max connections = 5 motd file = /etc/rsyncd/rsyncd.motd log file = /var/log/rsync.log [home] path = /home list = yes ignore errors auth users = root hosts allow = 客户端IP secrets file = /etc/rsyncd/rsyncd.secrets strict modes = yes [home2] path = /home2 list = yes ignore errors auth users = root hosts allow = 客户端IP secrets file = /etc/rsyncd/rsyncd.secrets strict modes = yes [home3] path = /home3 list = yes ignore errors auth users = root hosts allow = 客户端IP secrets file = /etc/rsyncd/rsyncd.secrets strict modes = yes [cvs] path = /cvs list = yes ignore errors auth users = root hosts allow = 客户端IP secrets file = /etc/rsyncd/rsyncd.secrets strict modes = yes #
4,#cat /etc/xinetd.d/rsync
# default: off # description: The rsync server is a good addition to an ftp server, as it # allows crc checksumming etc. service rsync { disable = no #开 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon --config=/etc/rsyncd/rsyncd.conf #主配置文件的位置 log_on_failure += USERID } # service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] # netstat -tulpn | grep :873 tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 26323/xinetd
# rpm -qa | grep rsync rsync-3.0.6-4.el5_7.1
2,#直接用命令复制
rsync -avz --progress --delete root@服务端IP::home /home --password-file=/etc/rsyncd.secrets rsync -avz --progress --delete root@服务端IP::home2 /home2 --password-file=/etc/rsyncd.secrets rsync -avz --progress --delete root@服务端IP::home3 /home3 --password-file=/etc/rsyncd.secrets rsync -avz --progress --delete root@服务端IP::cvs /cvs --password-file=/etc/rsyncd.secrets
客户端的rsyncd.secrets文件里只要写上密码即可
其中-a 代表rlptgoD,其实就是保证目录及文件的权限,修改时间,属主,组等一致标签:
原文地址:http://www.cnblogs.com/fenle/p/4468864.html