Rsync服務端部署流程

來源:互聯網
上載者:User

標籤:os   ar   檔案   art   div   sp   on   c   ad   

Rsync服務端部署流程   

Rsync服務端部署流程:

一、rsync服務端配置流程

  1. 配置rsync設定檔/etc/rsyncd.conf
  2. 建立同步的本地目錄/dingjian 並根據需要授權

目錄和/etc/rsync.password為設定檔中path = /dingjian/參數的配置

  1. 帳號密碼檔案配置:

echo "rsync_backup:dingjian">/etc/rsync.password

chmod 600 /etc/rsync.password

提示:

1)/etc/rsync.password為設定檔中secrets file = /etc/rsync.password參數的配置

2)帳號rsync_backup為/etc/rsync.password為設定檔中auth users = rsync_backup參數的配置

4.  啟動rsync服務

[[email protected] dingjian]# rsync --daemon

[[email protected] dingjian]# echo "/usr/bin/rsync --daemon">>/etc/rc.local

[[email protected] dingjian]# cat /etc/rc.local |grep daemon

[[email protected] dingjian]# ps -ef |grep rsync

 

重起

[[email protected] dingjian]# pkill rsync

[[email protected] dingjian]# rsync --daemon

[[email protected] dingjian]# ps -ef |grep rsync

 

二、rsync用戶端配置流程:

[[email protected] etc]# echo "dingjian">/etc/rsync.password

chmod 600 /etc/rsync.password

提示:

用戶端的/etc/rsync.password和服務端的/etc/rsync.password沒有任務關係,只要和用戶端rsync命令接的參數—password-file=/etc/rsync.password中的路徑對應即可

 

 

三、rsync用戶端命令操作細節

推送整個目錄

rsync -avz /tmp [email protected]::dingjian --password-file=/etc/rsync.password

只推送目錄中的檔案

rsync -avz /tmp/ [email protected]::dingjian --password-file=/etc/rsync.password

 

抓取rsync模組對應目錄裡的檔案

rsync -avz [email protected]::dingjian --password-file=/etc/rsync.password /tmp

Rsync服務端部署流程

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.