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
    

      

      

      

  • 相关阅读:
    华为lab-rs-v1-2.11_OSPF与ISIS互通
    jdk源码分析红黑树——插入篇
    jdk源码分析PriorityQueue
    jdk源码分析ArrayDeque
    jdk链表笔记
    jdk顺序表笔记
    SpringMVC类型转换器、属性编辑器
    SpringMVC基本使用
    spring整合hibernate
    spring aop注解配置
  • 原文地址:https://www.cnblogs.com/xiaofeng666/p/13353814.html
Copyright © 2011-2022 走看看