标签:linux rsync
deamon方式就是先搭建一个服务器,这个服务器上面跑一个rsync服务,服务就称为deamon(deamon就是实时运行的程序),rsync监听端口是873,然后在客户端上面使用rsync命令,实现和服务器之间推拉动作。(推拉都是在客户端执行rsync命令)
1. 统一版本:
[root@backup ~]# uname -m
x86_64
[root@backup ~]# uname -r
2.6.32-642.el6.x86_64
[root@backup ~]# rsync --version
rsync version 3.0.6 protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
查看rsync程序是否存在
[root@backup ~]# rpm -qa rsync
rsync-3.0.6-12.el6.x86_64
如果不存在rsync就用yum install rsync -y 安装。
2.rsync服务器搭建在备份服务器上面,然后在所有服务器上面通过命令就是推拉了。
[root@backup ~]# ll /etc/rsyncd.conf
ls: cannot access /etc/rsyncd.conf: No such file or directory
配置文件rsyncd.conf默认是不存在的
[root@backup ~]# vim /etc/rsyncd.conf
中插入如下信息:
#rsync_config__________start
##rsyncd.conf start##
uid=rsync
gid=rsync
use chroot=no
max connections=200
timeout=300
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsync.lock
log file=/var/log/rsyncd.log
[backup]
path=/backup
ignore errors
read only=false
list=false
hosts allow=172.16.1.0/24
hosts deny=0.0.0.0/32
auth users=rsync_backup
secrets file=/etc/rsync.password
#rsync_config________end
/etc/rsyncd.conf配置信息解释
##rsyncd.conf start##
uid=rsync #用户uid
gid=rsync #用户gid
use chroot=no
max connections=200 #最大连接数
timeout=300 #超时参数
pid file=/var/run/rsyncd.pid #进程号对应的文件
lock file=/var/run/rsync.lock #锁文件,防止文件不一致
log file=/var/log/rsyncd.log #日志文件
[backup] #模块
path=/backup
ignore errors
read only=false
list=false
hosts allow=172.16.1.0/24
hosts deny=0.0.0.0/32
auth users=rsync_backup
secrets file=/etc/rsync.password
#rsync_config________end
本文出自 “sandshell” 博客,请务必保留此出处http://sandshell.blog.51cto.com/9055959/1952198
标签:linux rsync
原文地址:http://sandshell.blog.51cto.com/9055959/1952198