zoukankan      html  css  js  c++  java
  • rsync同步配置

    因为公司数据库比较重要,现在只有一台服务器,IP为:118.145.*.*暂称为server,公司一台虚拟机,IP为。192.168.0.100 ,暂称为rsync

    1、安装服务器端:yum -y installxinetd
    2、安装路径:/etc/xinetd.d/
    3、启动路径: /etc/init.d/xinetdstart
    4、配置文件:/etc/rsyncd.conf

    在家里建立两台虚拟机,10为server,201为client ,可以实现同步
    rsync同步配置
    实现只同步2个目录中不同的部分。速相对快一些


    网站服务器配置rsyncd,/etc/rsyncd.conf配置
    [sitebackup]                               // name
    path = /opt/sh                  // copied directory
    use chroot = no
    hosts allow = *
    hosts deny = *
    list = true
    uid = nobody
    gid = nobody
    #log file = /var/log/rsyncd.log
    #auth users = mysql
    #secrets file = /etc/rsyncd.secrets

    因为服务器的ssh端口改变了,不再是22了。所以本地机子链接时需要定义rsh
    rsync -zvr --rsh='ssh -p622' root@IP:/opt/sh/ /Backup/
    这样就可以把服务器端的/opt/sh/下的文件差异同步到本地
    rsync --daemon 启动成功,netstat确认873有监听。

  • 相关阅读:
    Servlet的数据库访问
    Servlet 网页重定向
    Intellij idea创建javaWeb以及Servlet简单实现
    Tomcat
    QQ简易版
    单例
    centos7 jdk安装
    centos7 allure安装
    centos中执行apt-get命令提示apt-get command not found
    centos mysql使用踩过的坑
  • 原文地址:https://www.cnblogs.com/94YY/p/3873489.html
Copyright © 2011-2022 走看看