rsync 服务端和客户端 简单配置

环境:Centos 6.9

两台服务器,A(192.168.223.129) 和 B(192.168.223.130)。A 作为服务端,B作为客户端从A服务器同步目录。把A的/usr/src 目录下的内容同步到B的/rsync/ 目录。

首先配置下epel 源:

rpm -ivh https://mirrors.ustc.edu.cn/epel/epel-release-latest-6.noarch.rpm

全都先安装下rsync:

yum install rsync

然后,A 先创建/etc/rsyncd.conf 配置文件(默认没有),内容如下:

uid = nobody
gid = nobody
#hosts allow = *
hosts allow = 192.168.223.130
use chroot = no
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log

[tools]
path = /usr/src
comment = Rsync share test
auth users = haha
secrets file = /etc/rsync_users
read only = yes

echo "haha:1234567" >/etc/rsync_users #配置同步需要的用户和秘密

chmod 600 /etc/rsync_users  #必须要修改权限,不然会报错

开启服务端:

rsync --daemon --config=/etc/rsyncd.conf

会已守护进程的方式后台运行。

可以把这句写到/etc/rc.local 中,开机启动。

rsync 监听端口是873,说明服务端已经配置好了。

接下来是B服务器客户端:

客户端不用配置配置文件,直接可以从服务端同步目录,命令如下:

/usr/bin/rsync -avzP --delete --password-file=/etc/rsync.pass [email protected]::tools /rsync/

注意:客户端要生成/etc/rsync.pass 这个密码文件(路径随意),内容是同步账号的密码,即:echo "1234567" >/etc/rsync.pass, 并且权限要是600,不然会报错。

如图,从A 服务器同步过来两个文件夹和一个文件。

时间: 2024-07-31 14:03:31

rsync 服务端和客户端 简单配置的相关文章

SVN1.6服务端和客户端安装配置指导

本节向大家描述SVN1.6服务端和客户端安装配置步骤,随着SVN的快速发展,版本也进行了升级更新,本节就和大家一起学习一下SVN1.6服务端和客户端安装配置步骤,欢迎大家一起来学习.下面是具体介绍.1.软件下载下载SVN1.6服务器程序.http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91[注意]如果之前已经安装了TortoiseSVN客户端,必须选择与之配套的SVN服务端版本,否则会出现各种问题,可以从Tor

rsync服务端和客户端配置自动化配置脚本

系统版本CentOS release 6.9 (Final)2.6.32-696.el6.x86_64 x86_64 rsync 服务端IP:172.16.1.41 计算机名:backuprsync客户端IP:172.16.1.31 计算机名:nfs 服务器配置: [[email protected] scripts]# cat backup_server.sh #!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/

windows服务期间rsync服务端与客户端的数据同步

一.软件 服务器端与客户端软件分别为cwRsyncServer_4.2.0和cwRsync4.2.0 下载地址为:http://www.jb51.net/softs/39404.html 二.环境介绍 server端系统为win 2003,其IP为10.240.210.88:客户端端为winXP SP3,其IP为10.240.210.206 三.安装 分别在服务端与客户端安装对应版本的软件,默认安装即可.我这里服务端的安装路径为:E:\Program Files\ICW,客户端安装路径为 四.配

rsync 服务端和客户端配置--综合架构(干货分享)

rsync 服务器配置文档 1. 配置/etc/rsyncd.conf文件,写入如下内容: uid = rsync gid = rsync fake super = yes use chroot = no max connections = 2000 timeout = 600 pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log ignore errors re

ntp服务端和客户端同步配置

ntp服务端配置(centos7) 一.打开UDP123端口INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT.然后重启防火墙服务器  service firewalld restart 或直接关闭防火墙service firewalld stop,    chkconfig firewalld off 二.查看有没有ntp服务rpm –qa|grep ntp,如果没有则安装yum install –y ntp 三.要同步

cas 服务端和客户端证书配置(详细)

证书的配置 主要分为两大步:服务端生成配置证书,应用端导入证书. SSO服务端 生成keystore, 此文件用于tomcat/conf/server.xml中配置及导出证书: keytool -genkey -keyalg RSA -alias mlongbosso -dname "cn=passport.mlongbo.com" -keystore /home/ndoc/test/cas/mlongbosso.keystore -storepass 123654 说明:指定使用RS

关于一个WCF调用的服务端和客户端的配置信息集合

客户端的配置我知道. 但是: httpTransport maxReceivedMessageSize="2147483647" <dataContractSerializer maxItemsInObjectGraph="2147483647"/> <httpRuntime maxRequestLength="2097151"/> 上述三个还真没有如何用过! http://www.cnblogs.com/xuezhi/a

CnetOS 6.6 rsync 的服务端和客户端配置

CentOS 6.6 rsync 的服务端和客户端配置 基本信息 系统版本 主机名 IP地址 角色 CentOS  6.6 backup 10.0.0.10 rsync服务端 CentOS  6.6 lamp01 10.0.0.8 rsync客户端 CentOS  6.6 lnmp02 10.0.0.9 rsync客户端 服务端配置 创建rsync配置文件,并写入配置内容(默认rsync文件是不存在的,需要创建) [[email protected] ~]# touch/etc/rsyncd.c

CentOS Rsync服务端与Windows cwRsync客户端实现数据同步

CentOS Rsync服务端与Windows cwRsync客户端实现数据同步 2012年05月06日 ? Rsync ? 暂无评论 ? 被围观 3,622次+ 说明: 1.Rsync服务端 系统:CentOS 5.5 IP地址:192.168.21.160 数据存放目录:/data/osyunwei 2.cwRsync客户端 系统:Windows Server 2003 IP地址:192.168.21.130 同步的目录:D:\osyunwei 实现目的: cwRsync客户端每天凌晨3:0