• Linux RSync 搭建


    安装:

    • yum -y install xinetd

    端口开放:

    • iptables -A INPUT -p tcp -m state --state NEW  -m tcp --dport 873 -j ACCEPT

    服务端配置:

    • su - root
    • vim /etc/rsyncd.conf
    pid file = /var/run/rsyncd.pid
    log file = /var/log/rsyncd.log
    lock file = /var/run/rsync.lock
    
    address = 192.168.1.1
    port = 873
    uid = root
    gid = root
    use chroot = yes
    hosts allow = 192.168.1.0/255.255.255.0 192.168.2.0/255.255.255.0
    hosts deny = *
    max connections = 4
    
    [videoresource]
    path = /data/resource
    read only = no
    write only = no
    list = yes
    ignore errors
    auth users = root
    secrets file = /etc/rsyncd.secrets
    comment = This is 192.168.1.1
    • vim /etc/rsyncd.secrets 
    root:123456
    • chmod 600 /etc/rsyncd.secrets
    • /usr/bin/rsync --daemon --config=/etc/rsyncd.conf

    客户端:

    • vim /etc/rsyncd.secrets
    123456
    • chmod 600 /etc/rsyncd.secrets

    测试:

    • /usr/bin/rsync --list-only root@192.168.1.1::videoresource --password-file=/etc/rsync.secrets

    本地同步:

    • /usr/bin/rsync -vzrtopg  --progress  /data/* /data1/*

    上传:

    • /usr/bin/rsync -vzrtopg  --progress  /data/* root@192.168.1.1::videoresource

    下载(限速5MB):

    • /usr/bin/rsync -vzrtopg  --progress  --bwlimit=5000 root@192.168.1.1::videoresource/* /data/

    参考文献:http://www.cnblogs.com/itech/archive/2009/08/10/1542945.html

    参考文献:http://www.linuxidc.com/Linux/2016-10/136143.htm

    参考文献:http://sookk8.blog.51cto.com/455855/328076/

  • 相关阅读:
    正则表达式与领域特定语言(DSL)
    css兼容性问题的整理
    ASP.NET Web API 2.0新特性:Attribute Routing1
    架构讨论
    用Jekyll在github上写博客
    日历插件(beta)
    SQLSERVER数据库自动备份工具SQLBackupAndFTP(功能全面)
    Maven中有三大模块
    hdu 2444
    4.4 从一个表向另外的表中复制行
  • 原文地址:https://www.cnblogs.com/jhc888007/p/7413570.html
Copyright © 2020-2023  润新知