2009年6月18日 星期四

Centos 的 rsync server

Centos 的 rsync server

實做的結果:

1- 原來是以 B2D 做的,但最近要備份 Synology DS207 及DS207+,
 才發覺 B2D 的 Big-5 內碼與 Synology 的 Utf-8 出問題,只好
 以 Centos 5.3 做。

2- Centos 用 YUM ,版本是 rsync-2.6.8-3.1.i386 。
  
  yum install rsync

3- 安裝後檢查一下:yum list installed | grep rsync

4- 修改/etc/xinetd.d/rsync,參考自 架設 rsync 伺服器
  
  vi /etc/xinetd.d/rsync
  
  service rsync
  {
  disable = yes
  socket_type = stream
  wait = no
  user = root
  server = /usr/bin/rsync
  server_args = –daemon
  log_on_failure += USERID
  }
  
  disable = yes 改成 disable = no
  
  然後重新啟動xinetd 。
  
  /etc/init.d/xinetd restart

5- 修改防火牆,開放 873 Port 。
  
  vi /etc/sysconfig/iptables
  /sbin/service iptables start

6- 設定 rsyncd.conf
  
  [backup]
  path = /mybk      指定備份檔的存放位置。
  auth users = storylai   指定的備份用戶的授權名字(只是個名字)。
  uid = root        一定是 root ,不用改。
  gid = root 同上
  secrets file = /etc/rsyncd.secrets
  read only = no

7- 設定 rsyncd.secrets
  
  vi /etc/rsyncd.secrets
  # 填上storylai:123456       storylai 即上一項的備份用戶的授權名字及密碼。

8- 設定: chmod 600 rsyncd.conf 及 chmod 600 rsyncd.secrets

9- Synology DS207 設定如下圖。
  
  (1) 要設的位置。
  (2) 選 rsync 相容伺服器。
  (3) 填上 rsync 伺服器位置。
  (4) 即上述第 6 點的 path ,要對應好。
  (5) 即上述第 6 點的 auth users ,要對應好。
  (6) 即上述第 7 點的 123456 密碼 ,要對應好。
    



  
  

沒有留言: