自我介紹

shian

Tis night: now doth my longing break forth in me as a fountain ,-for speech do I long.

Menu:

Recent Entries

About

Tis night: now doth my longing break forth in me as a fountain ,-for speech do I long.

Categories

網管工作 [85]
隨想手札 [35]
資訊教育 [25]

Links

請按右鍵在新視窗開啟
- 發現自在的藍天
- 藍屋頂白牆上的陽光
- 網路書籤
- ㄚ比家族日記
- shian's 資訊組相簿
- shian's 個人相簿
- 學習手札
資訊管理
- 阿欣部落
- CHICWORKS
- ADJ 網路實驗室
- 創意MOODLE新聞區
資訊教育
- 華龍國小數位學習網
- 獅湖國小BIG6網站
- IN TIME
攝影photo
- Blue JOE Photo Diary
- Free printable cardboard lens hoods
- Contax Lens Hoods
- 景深計算機
- 如何看待觀景窗的大小
- CONTAX & Zeiss T* image
- 攝影教學課程資訊網
- Wisely 攝影風情
- David 老師的PhotoStory

Syndicate

RSS 0.90
RSS 1.0
RSS 2.0
Atom 0.3

Version:

andreas01 v1.3

rsync 於 FreeNAS0.683b 實作

shian | 09 四月, 2007 12:41

實作主機環境:ms5 網頁主機的目錄 /var/www 和 FreeNAS0.683b主機的目錄 /mnt/share/ms5/www 以 rsync同步備份

實做之前你必須先要有 rsync 資料同步 的概念

步驟:

(一)FreeNAS主機 作為 rsync server

1.於FreeNAS主機建立 rsync 的使用者(使用者名稱可以自訂)


2.啟動FreeNAS的 RSYNCD伺服器端 服務

3.使用FreeNAS主機的web管理介面 診斷-->編輯檔案 修改編輯FreeNAS主機的rsyncd.conf檔案 (路徑在於/var/etc/rsyncd.conf)
--------------------------------------------
read only = no
syslog facility = local4
list = yes
port = 873
pid file = /var/run/rsyncd.pid
uid = rsync
   
[share1]                                         
//分享的rsync區段的設定名稱
comment =
path = /mnt/share/ms5/www             
//想要在FreeNAS主機同步的目錄

----------------------------------------------



4.於FreeNAS主機建立同步的目錄/mnt/share/ms5/www
   #mkdir
/mnt/share/ms5
   #mkdir /mnt/share/ms5/www


5.更改/mnt/share/ms5/www 目錄的擁有者為rsync,否則系統會顯示存取權限錯誤
  ------------------------------------------------------------------------------------
  rsync: failed to set times on "/." (in share1): Operation not permitted (1)
  rsync: failed to set times on "/." (in share1): Operation not permitted (1)

  sent 1568785 bytes  received 22 bytes  184565.53 bytes/sec
  total size is 6139247012  speedup is 3913.32
  rsync error: some files could not be transferred (code 23) at main.c(977) 
  [sender=2.6.9]
  -------------------------------------------------------------------------------------
 
#chown -R rsync /mnt/share/ms5/

(二)ms5(www)主機 作為 rsync client

1.www主機必須先安裝好 rsync 服務
2.一般 rsync client 必須作以下的設定,可是在以FreeNAS 作為rsync server 以下設定似乎可以省略:
---------------------------------------------------------------
編輯設定用來和rsync伺服端連結的密碼檔,內容為密碼.(密碼要和伺服端rsync使用者密碼相同)
      路徑: /root/rsyncd.secrets 
     (檔案名稱及路徑可以自行變更,執行時在--password-file 指定即可)
# chmod 600 /root/rsyncd.secrets 
----------------------------------------------------------------

4.執行rsync 同步指令,開始進行同步備份。

說明: rsync 指令            
-rvlHpogDtS 參數
--password-file=/root/rsyncd.secrets 密碼檔的位置
--delete 刪除傳送端已經不存在,而目的端存在的檔案
/var/www/ 要備份的資料來源
rsync@163.22.69.139::share1 透過rsync這個帳號,
連結rsync伺服端rsyncd.conf 的[share1]設定值.

ms5:~#/usr/bin/rsync -rvlHpogDtS --password-file=/root/rsyncd.secrets
--delete /var/www/ rsync@163.22.69.139::share1

building file list ... done
sent 1579487 bytes  received 16 bytes  351000.67 bytes/sec
total size is 6421238698  speedup is 4065.35
5.將這個執行命令加入crontab 定時執行同步備份。
注意:FreeNAS 的的rsyncd.conf檔案 (路徑在於/var/etc/rsyncd.conf)
如果FreeNAS server 重新啟動,它會自動恢復成預設內容(恢復原狀)
因此你必須再次更改一遍。

Posted in 網管工作 . 迴響: (0). 引用:(0). 靜態連結網址
«Next post | Previous post»