rsync 服务器文件同步备份
一、安装rsync服务器
下载地址:/
服务器
wget -
tar zxvf rsync-
cd rsync-
./configure --prefix=/usr/local/rsync
make && make install
配置
vi /etc/
uid = nobody
gid = nogroub
use chroot = no
max connections = 4 #最大连接
pid file = /var/run/
lock file = /var/run/
log file = /var/log/ #日志
[web]
path = /data/appweb/ #要备份文件路径
ignore errors
read only = true
list = false
hosts allow = #充许的IP连接
hosts deny = #拒绝的IP
auth users = rsyncuser #认证用户要与/etc/
secrets file = /etc/ #密码存放路径
说明:
ignore errors
指定rsyncd在判断是否运行传输时的删除操作时忽略server上的IP错误,一般来说rsync在出现IO错误时将将跳过--delete操作,以防止因为暂时的资源不足或其它IO错误导致的严重问题。
read only
该选项设定是否允许客户上载文件。如果为true那么任何上载请求都会失败,如果为false并且服务器目录读写权限允许那么上载是允许的。默认值为true。
list
该选项设定当客户请求可以使用的模块列表时,该模块是否应该被列出。如果设置该选项为false,可以创建隐藏的模块。默认值是true。
vi /etc/
rsyncuser:rsyncpass 用户名、密码
权限
chmod 600 /etc/
chmod 600 /etc/
启动
#/usr/local/rsync/bin/rsync --daemon
#ps aux|grep rsync #查看是否已经启动
自启动
vi /etc/
/usr/bin/rsync --daemon # 以守护进程启动
二、客户端
系统默认就安装了rsync
如果没有安装,请使用 yum inst
rsync服务器文件同步备份 来自淘豆网www.taodocs.com转载请标明出处.