首页 > 系统服务 > 详细

linux rsync使用总结

时间:2020-03-14 12:24:48      阅读:64      评论:0      收藏:0      [点我收藏+]

一. 在本机上直接运作,用法就与 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]::[远端目录路径和文件] [本地路径]

       

        

linux rsync使用总结

原文:https://www.cnblogs.com/wangzengyi/p/12491153.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!