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
    
    
    

      

  • 相关阅读:
    JS(五)
    typescript(02)
    typescript(01)
    opensuse15.1字符界面下配置网络
    docker 再次学习
    load dll get last error 14001 Error: The Side-by-Side configuration information for XXXX.DLL contains errors. sxstrace.exe (14001).
    DRF序列化与反序列化
    《流畅的python》:生成字典的几种方式
    《流畅的python》:bisect来管理已排序的序列
    《流畅的python》:由*初始化一个由列表组成的列表
  • 原文地址:https://www.cnblogs.com/schangech/p/5760320.html
Copyright © 2011-2022 走看看