首页 > 代码库 > rsync

rsync

常用场景

无密码同步

服务端:vim /etc/rsyncd.conf

#This is the rsync daemon configuration

#global settings
pid file = /var/run/rsyncd.pid
port = 873
lock file = /var/run/rsyncd.lock
log file = /var/log/rsync.log
gid = root
uid = root

#module settings
[share_data]
path = /web/rsync/share_data
use chroot = no
max connections = 15
read only = yes
write only = no
list = no
ignore errors = yes
timeout = 120

/usr/bin/rsync --daemon
mkdir -p /web/rsync/share_data

客户端

rsync -avz --progress root@192.168.1.98::share_data /home/hadoop/share_data

 限制流量同步

rsync -avz --bwlimit=50 --progress root@192.168.1.98::share_data /home/hadoop/share_data

rsync