安装

yum install rsync

mkdir /etc/rsyncd

cd /etc/rsyncd

vi rsyncd.conf

 

pid file = /var/run/rsyncd.pid
uid = root
gid = root use chroot = no
read only = yes #limit access to private LANs
hosts allow=192.168.1.2/32,127.0.0.1/32
hosts deny=* max connections = 5
motd file = /etc/rsyncd/rsyncd.motd #This will give you a separate log file
log file = /var/log/rsync.log #This will log every file transferred - up to 85,000+ per user, per sync
transfer logging = yes log format = %t %a %m %f %b
syslog facility = local3
timeout = 300 [ftp_home]
path = /ftp_data/ftp_dir
list=yes
ignore errors
auth users = ftpuser
#secrets file = /etc/rsyncd/rsyncd.secrets
comment = This is test data

  启动服务

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

  关闭服务

kill `cat /var/run/rsyncd.pid`

   

查看服务

tail /var/log/rsync.log
ps aux|grep rsync
netstat -apn|grep 873

  加入开机启动

echo "/usr/bin/rsync --daemon  --config=/etc/rsyncd/rsyncd.conf" >> /etc/rc.local

  同步数据

rsync --list-only ftpuser@127.0.0.1::ftp_home

rsync -ave ssh root@127.0.0.1:/ftp_data/test1 .

  

注意server密码文件是"用户名:密码",客户端那边只用"密码"。两边都需要chmod 600 rsyncd.secrets

rsync -rtvzPL --include-from=rsync_include.lst  --password-file=/etc/rsyncd.secrets /source_rsync/ gameserverlog@192.168.0.1::game_server_log_rsync

vi rsync_include.lst
+ itemdata*.txt
+ data*.txt
- *

查看服务器列表

rsync --list-only --password-file=rsyncd.secrets  gameserverlog@192.168.0.1::gmweb_log_rsync

 服务器配置文件

vi /etc/rsyncd.conf

[gmweb_log_rsync]
comment = public archive
path = /data/log/test1_vn
lock file = /var/lock/log_rsyncd
read only = no
list = yes
uid = jslog
gid = jslog
auth users =gameserverlog
secrets file = /etc/rsyncd.secrets
hosts allow=192.168.1.1
hosts deny =*
timeout =
refuse options = checksum dry-run

rsync安装使用的更多相关文章

  1. Rsync安装部署

    Rsync安装部署 1.Rsync  简介 Rsync  是一款开源的.快速的 多功能的 可以实现全量以及增量的本地或者是远程的数据同步备份的优秀工具,并且可以不进行改变原有的数据属性信息,实现数据的 ...

  2. rsync安装配置及故障解决完全教程[window, 文件同步]

    Rsync是的全称是: remote synchronize, 也就是远程同步数据, 它是一款不错的文件同步软件,而且是免费的, 它在镜像保存整个目录树和文件系统的同时保持原来文件的权限.时间.软硬链 ...

  3. rsync安装及配置

    一.Server端 CentOS 6下安装yum -y install xinetd1.配置:vi /etc/xinetd.d/rsyncservice rsync{    disable = yes ...

  4. rsync 安装与配置

    1.什么是rsync Rsync(remote synchronize)是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件.Rsync使用所谓的“Rsync算法”来使本地和远 程两个 ...

  5. centos rsync安装配置

    安装 1 yum -y install rsync ---------------------服务器安装------------------------------- 创建基础配置文件 1 2 3 4 ...

  6. puppet aix package 之rsync安装

    AIX中使用RPM安装RSync遇到的问题及解决办法 最近在折腾AIX的系统,它里面本来有一个包管理工具叫installp,但是俺不会用,也不知道从那里找包. 幸亏AIX提供了RPM的支持,所以安装软 ...

  7. rsync 安装使用详解

    rsync是类unix系统下的数据镜像备份工具,从软件的命名上就可以看出来了——remote sync.它的特性如下:可以镜像保存整个目录树和文件系统.可以很容易做到保持原来文件的权限.时间.软硬链接 ...

  8. rsync安装及其配置

    服务端配置安装 服务器 第一步: 下载rsync 安装包(在线安装或者线下安装)         wget https://download.samba.org/pub/rsync/rsync-3.1 ...

  9. inotify+rsync安装配置

    环境 系统 IP地址 主服务器 CentOS7.4 192.168.1.1 备份服务器 CentOS7.4 192.168.1.2 一.备份服务器 安装rsync(备) wget https://rs ...

随机推荐

  1. Lvs+Keepalived+Squid+Nginx负载均衡

    前言* 随着互联网IT行业的发展,越来越多的企业开始使用开源软件搭建自己的web架构,主流的LVS也得到了广泛的应用,在保证高可用的同时,用户对网站的体验速度也有了很高的要求,这时候需要我们在我们的架 ...

  2. android学习笔记七——控件(DatePicker、TimePicker、ProgressBar)

    DatePicker.TimePicker ==> DatePicker,用于选择日期 TimePicker,用于选择时间 两者均派生与FrameLayout,两者在FrameLayout的基础 ...

  3. postgresql数据库文件目录

    不同的发行版位置不同 查看进程 ps auxw | grep postgres | grep -- -D 找到默认的目录 /usr/lib/postgresql/9.4/bin/postgres -D ...

  4. smartgit document Rebase

    The Rebase command allows you to apply commits from one branch to another. Rebase can be viewed as m ...

  5. MVC ViewData和ViewBag[转]

    转自:http://blog.csdn.net/a497785609/article/details/7854402#t0       视图数据可以通过ViewBag属性访问,它主要是为了从Contr ...

  6. 关于Servlet中的HttpServletRequest和HttpServletResponse

    1.HttpServletRequest 方    法 说    明 getAttributeNames() 返回当前请求的所有属性的名字集合 getAttribute(String name) 返回 ...

  7. sql如何获取一个时间段内的月份

    ),) from master..spt_values where type='P' and dateadd(month,number,'2010-01-01')<='2010-09-01' / ...

  8. Html5中的跨页面消息传输

    1.如果要接受从其他的窗口那里发过来的消息,就必须对窗口对象的message事件进行监控. window.addEventListener("message",function() ...

  9. java GUI之基本图形

    1.为了支持图形用户界面程序设计,java1.0的标准类库中包含一个抽象窗口工具箱(Abstract Window Toolkit,AWT). 这个工具箱极不成熟,其编程模型也不是面向对象的,有很大的 ...

  10. [kuangbin带你飞]专题二十 斜率DP

            ID Origin Title   20 / 60 Problem A HDU 3507 Print Article   13 / 19 Problem B HDU 2829 Lawr ...