1 安装rsync
tar zxvf rsync-3.0.6pre1.tar.gz
cd rsync-3.0.6pre1
./configure --prefix=/usr/local/rsync
make
make install
------------------------------------
2 生成配置文件
mkdir etc logs
cd etc
touch rsyncd.motd rsyncd.secrets rsync.pid rsync.conf
*rsyncd.motd
*rsyncd.secrets 存放账户和密码
*rsync.pid 程序启动把pid写入该文件
*rsync.conf程序配置文件
------------
[root@lvsip001 etc]# cat rsync.conf
pid file=/usr/local/rsync/etc/rsync.pid
port=873
address=10.10.1.73
uid=root
gid=root
use chroot=yes
read only=no
hosts allow=172.17.163.0/255.255.255.0
hosts deny=*
max connections=10
motd file=/usr/local/rsync/etc/rsyncd.motd
log file=/usr/local/rsync/logs/rsyncd.log
timeout=300
[login_db]
path=/opt/db/db_usermanager/
list=yes
ignore errors
auth users=root,koscom
uid=root
gid=root
secrets file=/usr/local/rsync/etc/rsyncd.secrets
read only=yes
----------------
[root@lvsip001 etc]# cat rsyncd.secrets
root:111111
----------------------------------------
3 启动
/usr/local/rsync/bin/rsync -4 --daemon --config=/usr/local/rsync/etc/rsync.conf --port=873
4 客户端测试(也可以安装这个rsync)
/usr/local/rsync/bin/rsync -avpz --delete --password-file=/usr/local/rsync/etc/mima /mnt/123/
将login_db的文件同步到/mnt/123中
密码文件/usr/local/rsync/etc/mima
mkdir /usr/local/rsync/etc/mima
[root@localhost etc]# cat /usr/local/rsync/etc/mima
111111
阅读(714) | 评论(0) | 转发(0) |