2009年12月10日 星期四

Linux rsync setup backup

設定Rsync Server端 [目的端]:
  #vi /etc/xinetd.d/rsync
    disable = no //把rsync功能打開
  #service xinetd restart

建立rsyncd.conf
  #vi /etc/rsyncd.conf
   [test]                                          //主機代號
   path = /tmp                                //備份資料放置的絕對路徑
   auth users = rsync-root                //定義帳號
   uid = root                                  //執行時的uid
   gid = root                                  //執行時的gid
   secrets file = /etc/rsyncd.secrets //認證密碼檔位置
   read only = no

建立rsyncd.screts
  #vi /etc/rsyncd.secrets
    rsync-root:123456    //帳號:密碼
   #chown root:root /etc/rsyncd.secrets
  # chmod 600 /etc/rsyncd.secrets

設定Rsync Client端 [來源端]:
建立rsyncd.screts
  #vi /etc/rsyncd.secrets
    123456        //密碼
  #chmod 600 /etc/rsyncd.secrets

執行測試
        server ip = 192.168.1.10
  #/usr/bin/rsync -vzrtopg --delete --password-file=
          /etc/rsyncd.secrets /tmp/12.txt rsync-root@
           192.168.1.10::test     
          
        //將/tmp/12.txt 備份至192.168.1.10下

沒有留言:

張貼留言