1.sudo apt-get install rsync

2.sudo nano /etc/rsyncd.conf

uid = 0

gid = 0

use chroot = no
read only = true
max connections = 4
syslog facility = local5
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
#secrets file = /etc/rsyncd.pwd

path = /www/mobilbe/media/

 

3 启动rsyncd

 

rsync --daemon --config=/etc/rsyncd.conf

4 客户端 

首先要安装一下,rsync配置可以不用动

rsync -参数 用户名@同步服务器的IP::rsyncd.conf中那个方括号里的内容 本地存放路径 如:
[root@BlackGhost local]# rsync -avzP soft@192.168.1.5::test /home/jack/Desktop