zoukankan      html  css  js  c++  java
  • Rsync同步设置的一例

    以下文档于2014-12-10更新

     

    先在服务端操作

    #wget http://pkgs.repoforge.org/rsync/rsync-3.0.9-2.el6.rfx.x86_64.rpm

    #rpm –ivh rsync-3.0.9-2.el6.rfx.x86_64.rpm

    #chkconfig rsync on

    #service xinetd restart    <如果提示没有此服务, yum –y install xinetd

    #因为一般没有rsyncd.conf配置文件.手动建一个

    #mkdir /etc/rsyncd

    #touch /etc/rsyncd/rsyncd.conf

    #ln –s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf

    #vim /etc/rsyncd.conf

    <以下为/etc/rsyncd/rsyncd.conf 文档>

    [global]

    uid = root

    gid = root

    use chroot = no

    max connections = 4

    strict modes = yes

    port = 873

    pid file = /var/run/rsyncd.pid

    lock file = /var/run/rsync.lock

    log file = /var/log/rsyncd.log

    [backup]

    path = /var/testrsync   

    comment = This is test

    read only = no

    write only = no

    auth users = root

    uid = root

    gid = root

    secrets file = /var/rsync.ps

    list = no

    截图如下:

     

    #touch /var/rsync.ps

    #echo “1qaz2wsx”>>/var/rsync.ps    <这个是将root的密码保留至/var/rsync.ps中>

    #chown root.root /var/rsync.ps

    #chmod 400 /var/rsync.ps

    <如果没有操作上面的那些步骤.会出现下面的错误的现象>

     

    <下面创建下测试的文件,这个路径与/etc/rsyncd/rsyncd.conf 中的path一致>

    #mkdir /var/testrsync

    #touch /var/testrsync/aa.txt

    #echo “hello”>>/var/testrsync/aa.txt

    在另外的一台服务器上面也做下相关的操作.

    # rsync -avzP --password-file=/var/rsync.ps root@192.168.1.182::backup /var/testrsync/

  • 相关阅读:
    【训练题】最优比率生成树 P1696
    2019/9/15 校内模拟赛 考试报告
    b 解题报告
    HDU4714 Tree2cycle 解题报告
    2019/9/2 校内练习赛 考试报告
    2019/8/31 校内模拟赛 考试报告
    2019/8/29 校内模拟赛 考试报告
    康托展开
    洛谷P3807卢卡斯定理
    矩阵
  • 原文地址:https://www.cnblogs.com/drgcaosheng/p/4157045.html
Copyright © 2011-2022 走看看