rsync可用于同步文件,一般架设在一台机器上备份文件到另外一台主机上。
rsync服务器端架设
安装rsync
下载解压并install
wget https://download.samba.org/pub/rsync/src/rsync-3.0.6.tar.gz
tar -zxvf rsync-3.0.6.tar.gz
./configure --prefix=/usr/local/rsync
make
make install
配置rsyncd.conf,不存在就手工创建/usr/local/rsync/rsyncd.conf
内容如下:
uid = root
gid = root
use chroot = yes
strict modes = false
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
####
log file = /var/log/rsyncd.log
transfer logging = true
log format= "%o [%a] %m (%u) %f %l %b %c"
##
reverse lookup = no
ignore errors = true
read only = false
hosts allow = 192.168.254.130
hosts deny = 0.0.0.0/0.0.0.0
strict modes = yes
list = false
max connections = 100
timeout = 1800
[www]
path = /data/www/
auth users = root
secrets file = /usr/local/rsync/rsyncd.sec