zoukankan      html  css  js  c++  java
  • linux rsync使用总结

    一. 在本机上直接运作,用法就与 cp 几乎一模一样,例如:
      rsync -av /etc /tmp (将 /etc/ 的数据备份到 /tmp/etc 内)

    二. 透过 rsh 或 ssh 的信道在 server / client 之间进行数据传输,例如:
      rsync -av -e ssh user@rsh.server:/etc /tmp (将 rsh.server 的 /etc 备份到本地主机的 /tmp 内)
    三. 直接透过 rsync 提供的服务 (daemon) 来传输,此时 rsync 主机需要启动 873 port:

      1. 你必须要在 server 端启动 rsync服务,启动方法在以下链接的super deamon启动方法里:https://www.cnblogs.com/wangzengyi/p/12451828.html

      2. 配置文件修改

      • pid file = /var/run/rsyncd.pid
        port = 873
        address = [本端服务器IP地址]
        uid = nobody
        gid = nobody
        
        use chroot = yes
        read only = yes
        
        #limit access to private LANs
        #hosts allow=192.168.31.0/24
        #hosts deny=*
        
        log file = /var/log/rsync.log
        
        log format = %t %a %m %f %b
        syslog facility = local3
        timeout = 300
        
        
        [pdns_host]
            path = /etc/pdns-recursor/
            uid = 0
            gid = 0
            read only = yes
            list = no
            hosts allow = 192.168.31.0/24 192.168.10.0/24
        vim /etc/rsyncd.conf  

      3. 使用方法

      • rsync -av [服务器IP]::[远端目录路径和文件] [本地路径]
          
  • 相关阅读:
    rabbitmq使用
    redis
    IO模型与IO复用介绍
    事件驱动与异步IO使用
    协程
    进程
    线程、锁
    paramiko模块与 StringIO模块
    socketserver 编程
    随记
  • 原文地址:https://www.cnblogs.com/wangzengyi/p/12491153.html
Copyright © 2011-2022 走看看