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

    rsync是由xinetd服务管理,需要安装xinetd

    [root@x112 ~]# yum install -y xinetd
    
    [root@x112 ~]# ps -ef| grep xin
    root       1269   1157  0 10:02 pts/0    00:00:00 grep --color=auto xin
    [root@x112 ~]# 
    [root@x112 ~]# systemctl start xinetd
    [root@x112 ~]# ps -ef| grep xin
    root       1277      1  0 10:02 ?        00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
    root       1279   1157  0 10:02 pts/0    00:00:00 grep --color=auto xin
    
    [root@x112 ~]# netstat -antup | grep 873
    [root@x112 ~]# netstat -antup | grep xin
    [root@x112 ~]# 
    
    [root@x112 ~]# rsync --daemon
    [root@x112 ~]# netstat -antup | grep 873
    tcp        0      0 0.0.0.0:873             0.0.0.0:*               LISTEN      1290/rsync         
    tcp6       0      0 :::873                  :::*                    LISTEN      1290/rsync         
    [root@x112 ~]# vim /etc/rsyncd.conf
    [root@x112 ~]# rsync --version
    rsync  version 3.1.2  protocol version 31
    Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
    Web site: http://rsync.samba.org/
    Capabilities:
    

     rsync使用系统账号传送文件

    [root@x112 ~]# rsync -avz --delete /var/www/html  get1@192.168.0.170:/web1
    

     

    rsync使用非系统账号传送文件:,需要编辑/etc/rsyncd.conf文件

    /etc/rsyncd.conf文件,在启动rsync --daemon后就会自动生成。

    使用rsync借助ssh无口令登陆远程备份到rsync服务器指定目录

    [root@x111 software]# ssh-keygen -t rsa
    [root@x111 software]# ssh-copy-id  -i .ssh/id_rsa.pub 192.168.0.112
    [root@x112 software]# rsync -e ssh -avz nginx-1.14.2 192.168.0.101:/home/webserver
    [root@x112 software]# rsync -e ssh -avz Discuz_7.2_FULL_SC_UTF8.zip root@192.168.0.101:/home/webserver
    

      

      

      

  • 相关阅读:
    STL与基础数据结构
    solr基础总结
    linux命令笔记
    SolrCloud集群部署
    oracle SQL笔记
    内存溢出之Tomcat内存配置
    solr查询优化(实践了一下效果比较明显)
    JAVA处理线程超时
    Solr 数据导入 <一>DIH简单使用
    几种防止表单重复提交的方法
  • 原文地址:https://www.cnblogs.com/xiaofeng666/p/13353814.html
Copyright © 2011-2022 走看看