<del id="d4fwx"><form id="d4fwx"></form></del>
      <del id="d4fwx"><form id="d4fwx"></form></del><del id="d4fwx"><form id="d4fwx"></form></del>

            <code id="d4fwx"><abbr id="d4fwx"></abbr></code>
          • linux中怎么設(shè)置rsync同步

            linux中怎么設(shè)置rsync同步,很多新手對此不是很清楚,為了幫助大家解決這個難題,下面小編將為大家詳細講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。

            成都創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供寧蒗網(wǎng)站建設(shè)、寧蒗做網(wǎng)站、寧蒗網(wǎng)站設(shè)計、寧蒗網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、寧蒗企業(yè)網(wǎng)站模板建站服務(wù),10多年寧蒗做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。

            [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 # 如果沒有安裝則手動安裝

            [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自動啟動
            [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(名字隨便寫,只要和上邊配置文件里的一致即可),格式(一行一個用戶)
            [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 啟動配置
            [root@test home]# /etc/init.d/xinetd restart
            Stopping xinetd:                                           [  OK  ]
            Starting xinetd:                                           [  OK  ]

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


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

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

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

            12 檢查rsync是否啟動
            [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 配置三個過程就可以了
              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 [email protected]::backup /home/

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

            看完上述內(nèi)容是否對您有幫助呢?如果還想對相關(guān)知識有進一步的了解或閱讀更多相關(guān)文章,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝您對創(chuàng)新互聯(lián)的支持。

            新聞名稱:linux中怎么設(shè)置rsync同步
            鏈接分享:http://www.jbt999.com/article16/jjesdg.html

            成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、小程序開發(fā)、微信小程序、微信公眾號企業(yè)網(wǎng)站制作、網(wǎng)站排名

            廣告

            聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:[email protected]。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

            h5響應(yīng)式網(wǎng)站建設(shè)

              <del id="d4fwx"><form id="d4fwx"></form></del>
              <del id="d4fwx"><form id="d4fwx"></form></del><del id="d4fwx"><form id="d4fwx"></form></del>

                    <code id="d4fwx"><abbr id="d4fwx"></abbr></code>
                  • 国产性爱电影一区二区三区 | 午夜视频一区二区三区 | 欧美中文网 | 日本黄色免费视频网站 | 三级片的网站 |