zoukankan      html  css  js  c++  java
  • Rsync 基础配置

    rsync 部署/同步

    cat /etc/rsyncd.conf

    # /etc/rsyncd: configuration file for rsync daemon mode
    # See rsyncd.conf man page for more options.
    # configuration example:
    
    uid = nobody
    gid = nobody
    port = 873
    use chroot = yes
    timeout = 900
    ignore nonreadable = yes
    dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
    
    max connections = 20
    #hosts allow = 10.200.0.0/255.255.0.0
    log file = /var/log/rsync.log
    transfer logging = yes
    log format = %t %a %m %f %b
    syslog facility = local3
    timeout = 300
    lock file = /var/run/rsyncd.lock
    pid file = /var/run/rsyncd.pid
    #secrets file = /etc/rsyncd/rsyncd.secrets
    #motd file = /etc/rsyncd/rsyncd.motd
    
    [indexdata]
    path = /indexdata
    comment = base data diretory
    list = yes
    ignore errors
    read only = false
    transfer logging = yes
     
    

      

    针对有账号,密码认证的方式,只查看,不同步

    【注意点:关于密码文件的权限,必须是 600 ,chmod 600 /tmp/pass ,服务端的制定密码文件也是】


    # 需要手动输入用户名和密码
    rsync -azv --list-only jeck@10.200.0.24::jeck /indexdata/

    # 通过文件方式,避免手动输入用户名和密码
    rsync -azv --delete --port 1873 --password-file=/tmp/pass jeck@10.200.0.24::jeck /indexdata/

    同步所有文件

    rsync -azv --delete jeck@10.200.0.24::jeck /indexdata/

    匿名方式
    rsync -azv --delete rsync://10.200.0.24/indexdata/jeck /indexdata/

    指定端口连接
    rsync -azv --delete --port 1873 jeck@10.200.0.24::jeck /indexdata/

    cat /etc/rsyncd.conf

    # /etc/rsyncd: configuration file for rsync daemon mode
    # See rsyncd.conf man page for more options.
    # configuration example:
    #
    # global options
    #
    #address = 10.200.0.24
    uid = nobody
    gid = nobody
    port = 1873
    log file = /var/log/rsync.log
    lock file = /var/run/rsyncd.lock
    pid file = /var/run/rsyncd.pid
    secrets file = /etc/rsyncd/rsyncd.secrets
    motd file = /etc/rsyncd/rsyncd.motd
    
    transfer logging = yes
    #log format = %t %a %m %f %b
    log format = "%o [ %a ] %m (%u) %f %b %l %b"
    syslog facility = local3
    
    
    use chroot = yes
    timeout = 900
    ignore nonreadable = yes
    dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
    
    max connections = 20
    #hosts allow = 10.200.0.0/255.255.0.0
    timeout = 300
    
    #hosts allow = 10.200.0.56
    #hosts deny = 10.200.0.33
    
    [indexdata]
    path = /indexdata
    comment = base data diretory
    list = false 
    ignore errors
    read only = false
    transfer logging = yes
    #exclude = mac/
    
    [jeck]
    path = /indexdata/jeck
    comment = jeck data
    list = yes
    ignore errors
    ignore nonreadable
    read only = false
    transfer logging = yes
    auth users = jeck
    secrets file = /etc/rsyncd/rsyncd.secrets
    
    [mac]
    path = /indexdata/mac
    comment = mac data
    list = false
    ignore errors
    ignore nonreadable
    read only = false
    transfer logging = yes
    
    
    

      

  • 相关阅读:
    javascript--运算符
    线程池 的创建小列子,以及参数的介绍
    @SpringBootApplication注解
    SpringBoot 基础知识学习(二)——配置文件多环境配置
    springboot 配置文件读取的两种方式,以及使用到的注解解释
    用虚拟机安装了一台Linux系统,突然想克隆一台服务器,克隆后发现无法上网,如何解决?
    ---oracle 数据库的设计,PL/SQL(loop,for,if,case,while)
    xml的解析技术, 它们之间的区别?
    -----oracle优化之表分区
    --------oracle 的伪表和伪劣,简单的分页
  • 原文地址:https://www.cnblogs.com/schangech/p/5760320.html
Copyright © 2011-2022 走看看