现在的位置: 首页 > 综合 > 正文

Linux中安装使用rsync

2018年05月03日 ⁄ 综合 ⁄ 共 985字 ⁄ 字号 评论关闭

获取 rsync-3.1.0  我的网盘里放了一个 。地址:

http://pan.baidu.com/s/1dDs4lSt


安装

rsync-3.1.0.tar.gz 
#tar zxvf rsync-3.1.0.tar.gz
#cd rsync-3.1.0
#./configure --prefix=/home/work/rsync
#make 
#make install


配置文件 举例

<span style="font-size:18px;">use chroot = no
max connections=36000
log file=/home/work/rsync/log/rsyncd.log
pid file=/home/work/rsync/rsyncd.pid
lock file=/home/work/rsync/rsyncd.lock

[data]
path = /home/work/www/
comment = data
auth users = work
uid = work
gid = work
secrets file = /home/work/rsync/etc/rsyncd.pas
read only = false
write only = yes</span>


启动

rsync --daemon --port 3334 --config=/home/work/rsync/conf/rsyncd.conf


错误1

@ERROR: setgroups failed
rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]

这个错我是由于 起服务的 rsync 和 传输的rsync的版本不用。后来换成一个版本后就好了。


推送命令

/home/work/rsync/bin/rsync -vzrtopg --progress --password-file=/home/work/fupeng/rsync/rsync.pas --port=3334 --bwlimit=20560   --exclude-from=/home/work/fupeng/batch_tool/push/exclude.txt  /home/work/www/ work@10.10.0.1::download

上面这个命令是 带 排除功能的推送

在exclude.txt   中写上 不想推送的文件,支持正则表达式。



抱歉!评论已关闭.