rsync安装配置文档

#1、一键安装rsync 

wget https://download.samba.org/pub/rsync/src/rsync-3.1.2.tar.gz && tar zxvf rsync-3.1.2.tar.gz && cd rsync-3.1.2 && ./configure make && make install

#2、编辑配置文件
vi /etc/rsyncd.conf 

######################配置开始##################

uid = root 
gid = root 
use chroot = no 
max connection=10
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsyncd.lock
log file=/var/log/rsyncd.log
#模块名
[sync]
path=/home/wwwroot/
read only = no
list=false
uid=root
gid=root
hosts allow=*
#用户名密码文件配置
auth users = sync
secrets file = /etc/rsyncd.pass

###############配置结束##############

#3、设置密码文件
echo "sync:password">>/etc/rsyncd.pass && chmod 600 /etc/rsyncd.pass



rsync -ravz   chen@192.168.1.1::sync/file     /root/
#      命令   用户名@IP:port::模块/file      /要同步的目录


rsync --daemon ##启动

①.daemon(服务端)模式:

②.普通(客户端)模式:

huan

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: