<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    持之以恒

    記錄本
    posts - 4, comments - 32, trackbacks - 0, articles - 74
      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    linux rsync同步設(shè)置詳細(xì)指南

    Posted on 2012-05-29 17:21 小白19870626 閱讀(16443) 評論(1)  編輯  收藏 所屬分類: linux
     
    配置rsync 同步數(shù)據(jù) rpm包安裝rsync及配置


    [root@Hammer home]# rpm -qa |grep rsync #檢查系統(tǒng)是否安裝了rsync軟件包
    rsync-2.6.8-3.1
    [root@Hammer CentOS]# rpm -ivh rsync-2.6.8-3.1.i386.rpm # 如果沒有安裝則手動(dòng)安裝

    [root@test rsync-3.0.4]# vim /etc/xinetd.d/rsync


    1 配置rsync servervi /etc/xinetd.d/rsync
    將disable=yes改為no

    service rsync
    {
    disable = no
    socket_type = stream
    wait = no
    user = root
    server = /usr/bin/rsync
    server_args = --daemon
    log_on_failure += USERID
    }

    2 配置rsync自動(dòng)啟動(dòng)
    [root@test etc]# chkconfig rsync on
    [root@test etc]# chkconfig rsync --list
    rsync on

    3 配置rsyncd.conf
    [root@test etc]# vim rsyncd.conf

    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 = /srv
    comment = This is test
    auth users = scihoo
    uid = root
    gid = root
    secrets file = /home/rsync.ps
    read only = no
    list = no


    4 確保etc/services中rsync端口號正確
    [root@test etc]# vim /etc/services
    rsync 873/tcp # rsync
    rsync 873/udp # rsync

    5 配置rsync密碼(在上邊的配置文件中已經(jīng)寫好路徑)/home/rsync.ps(名字隨便寫,只要和上邊配置文件里的一致即可),格式(一行一個(gè)用戶)
    [root@test etc]# vi /home/rsync.ps
    scihoo:scihoo

    6 配置rsync密碼文件權(quán)限
    [root@test home]# chown root.root rsync.ps
    [root@test home]# chmod 400 rsync.ps

    7 啟動(dòng)配置
    [root@test home]# /etc/init.d/xinetd restart
    Stopping xinetd: [ OK ]
    Starting xinetd: [ OK ]

    8 如果xinetd沒有的話,需要安裝一下
    [root@test home]# yum -y install xinetd


    啟動(dòng)rsync server
    RSYNC服務(wù)端啟動(dòng)的兩種方法
    9、啟動(dòng)rsync服務(wù)端(獨(dú)立啟動(dòng))
    [root@test home]# /usr/bin/rsync --daemon

    10、啟動(dòng)rsync服務(wù)端 (有xinetd超級進(jìn)程啟動(dòng))
    [root@test home]# /etc/init.d/xinetd reload

    11 加入rc.local
    在各種操作系統(tǒng)中,rc文件存放位置不盡相同,可以修改使系統(tǒng)啟動(dòng)時(shí)把rsync --daemon加載進(jìn)去。
    [root@test home]# vi /etc/rc.local
    /usr/local/rsync –daemon #加入一行

    12 檢查rsync是否啟動(dòng)
    [root@test home]# lsof -i :873
    COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
    xinetd 4396 root 5u IPv4 633387 TCP *:rsync (LISTEN)




    客戶端配置
    1 配置三個(gè)過程就可以了
    1.1 設(shè)定密碼文件
    1.2 測試rsync執(zhí)行指令
    1.3 將rsync指令放入工作排程(crontab)
    [root@aj1 home]# vi /etc/xinetd.d/rsync

    # default: off
    # description: The rsync server is a good addition to an ftp server, as it \
    # allows crc checksumming etc.
    service rsync
    {
    disable = yes
    socket_type = stream
    wait = no
    user = root
    server = /usr/bin/rsync
    server_args = --daemon
    log_on_failure += USERID
    }

    1.1 配置密碼文件 (注:為了安全,設(shè)定密碼檔案的屬性為:600。rsync.ps的密碼一定要和Rsync Server密碼設(shè)定案里的密碼一樣)
    [root@aj1 home]# vi rsync.ps
    sciooo

    [root@aj1 home]# chown root.root .rsync.ps # 注意必須給權(quán)限
    [root@aj1 home]# chmod 600 .rsync.ps # 必須修改權(quán)限

    1.2 從服務(wù)器上下載文件
    [root@aj1 rsync-3.0.4]# rsync -avz --password-file=/home/rsync.ps scihoo@192.168.0.206::backup /home/

    從本地上傳到服務(wù)器上去
    [root@aj1 rsync-3.0.4]# rsync -avz --password-file=/home/rsync.ps /home scihoo@192.168.0.206::backup


    小白

    評論

    # re: linux rsync同步設(shè)置詳細(xì)指南   回復(fù)  更多評論   

    2013-12-24 14:28 by littledog
    很好用,謝謝提供
    主站蜘蛛池模板: 女人被免费视频网站| 中国人xxxxx69免费视频| 色吊丝免费观看网站| 波多野结衣中文字幕免费视频| 亚洲AV永久无码精品成人| 久9久9精品免费观看| 亚洲国产精品免费视频| 在线观看免费视频资源| 亚洲精品午夜久久久伊人| 1000部免费啪啪十八未年禁止观看 | 亚洲精品制服丝袜四区| 久久久久久免费一区二区三区 | 亚洲AV无码无限在线观看不卡 | 在线A级毛片无码免费真人| 亚洲色www永久网站| 国产精品网站在线观看免费传媒| 国产亚洲精品影视在线产品| 亚洲乱码在线观看| 日韩一级在线播放免费观看| 日韩在线视精品在亚洲| 久久久久亚洲精品男人的天堂| 久久久久久久99精品免费观看| 亚洲网站在线播放| 日韩人妻无码免费视频一区二区三区 | 免费观看成人久久网免费观看| 亚洲无成人网77777| 在线免费观看一级毛片| 一区免费在线观看| 67pao强力打造67194在线午夜亚洲 | 亚洲成色www久久网站夜月| 四虎最新永久免费视频| 亚洲av日韩av天堂影片精品| 999国内精品永久免费观看| 亚洲AV无码专区在线厂| 亚洲热妇无码AV在线播放| www在线观看播放免费视频日本| 亚洲电影国产一区| 免费高清资源黄网站在线观看| 国产亚洲精品免费视频播放| 亚洲男人的天堂久久精品| 区三区激情福利综合中文字幕在线一区亚洲视频1 |