[Linux]rsync備份機制

| | 迴響 (23) | 引用 (0)


以下以Debian為操作環境。

**放備份資料的主機(Server)
1.安裝
  apt-get install rsync

2.改預設值
  vi /etc/default/rsync
    將RSYNC_ENABLE=false
    改成RSYNC_ENABLE=true

3.改設定檔
  vi /etc/rsyncd.conf
    [Home_bk_1]
      path = /home_bk_1 // 備份路徑
      auth users = hbk1 // 帳號
      uid = root
      gid = root
      secrets file = /etc/rsyncd.secrets // 密碼檔
      read only = no

4.設定帳號密碼
  vi /etc/rsyncd.secrets
    home_bk_1:rsync4ever // 帳號:密碼

5.修改權限和擁有者
  chown root:root /etc/rsyncd.secrets
  chmod 600 /etc/rsyncd.secrets

6.啟動rsync
  /etc/init.d/rsync start


**要備份的主機(Client)
1.安裝
  apt-get install rsync

2.設定密碼
  vi /etc/rsyncd.passwd
    rsync4ever // 僅需密碼

3.修改權限與擁有者
  chown root:root /etc/rsyncd.passwd
  chmod 600 /etc/rsyncd.passwd

4.開始備份
  rsync -arHz --progress --delete --password-file=/etc/rsyncd.passwd /home hbk1@xxx::Home_bk_1
    -a:保留權限,除了 Hard Link
    -r:遞迴地複製目錄中的所有子目錄
    -H:保留 Hard Link
    -z:資料備份前先壓縮
    --progress:顯示進度
    --delete:如果要備份的Client上刪除了某個檔案,備份的Server也刪除某個檔案
    --password-file:密碼檔的位置

5.自動化
  vi /etc/crontab
    0 5 * * * root /usr/bin/rsync -arHz --progress --delete --password-file=/etc/rsyncd.passwd /home hbk1@xxx::Home_bk_1


**資料的還原
1.直接在要還原資料的電腦執行rsync還原
  rsync -arHz --progress --delete --password-file=/etc/rsyncd.passwd hbk1@xxx::Home_bk_1 /home


    –參考Rostin's pLog臥龍小三網路管理技術文件

這篇屁話被收在分類:

0 則引用

本篇屁話的引用連結 : http://thecrap.org/mt-tb.cgi/70

引用 [Linux]rsync備份機制 的文章如下 :

23 則迴響

spo 說:

這個是你提到的兩台同步資料的方法嗎?

alvinwu 說:

是滴

Yeah they use to be cute together, now they are just annoying. Shelly should come back for mouth, i liked them best.

Good points. When I was in school we were forced to do math by hand. I was helping my nephew with his math the other day and he only had 2 steps written down. I noticed the answer was wrong so I asked him to walk through the steps and show me what he did. He paused and told me he put the equation in the calculator. I knew the problem immediately was an issue with order of operation, but I explained to him you cant just blindly plug it in the calculator and expect it to be right. I still have him walk through it and show me he knew how to do it.

Kam Nicholls 說:

My friend and I had been just talking over this specific problem, she in fact is normally wanting to prove me entirely wrong! I will show her this blog post and additionally rub it in just a little!

Tressa Hurren 說:

How do I go about removing articles that breach copyright?

Yes, i am glad that your asking us to know our opinion.

Couldnt be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!

What are some good blogging sites where your posts are actually read by others daily?

Bennie Arnot 說:

Yes, i am glad that your asking us to know our opinion.

We surely have to think more in that area to see what i can do about that.

nice posts and nice site Great post man! Continue!

Hmm it seems like your website ate my first comment (it was extremely long) so I guess I'll just sum it up what I had written and say, I'm thoroughly enjoying your blog. I as well am an aspiring blog blogger but I'm still new to everything. Do you have any suggestions for beginner blog writers? I'd really appreciate it.

Gloria Uknown 說:

I really like following your blog as the articles are so simple to read and follow. Excellent. Please keep up the good work. Thanks.

I just have removed into the future as well as integrated a web link to your web site from from my personal consumers prompting it. We've found applied ones weblog Website url: http://thecrap.org/2005/06/linuxrsync.html together with blog distinction: [Linux]rsync備份機制 - 憑你的智慧,我很難跟你解釋。 making sure that you have the best key phrases. If you would decide to have a look at whereby ones own link has been used, remember to e-mail myself on: Casher5000@gmail.com. With thanks, Khalid. I like to recommend this page as well: http://www.be-id.com/3d-renderings-3d-visualizations

Irma Loshek 說:

Yes, it shows what we need to know.

Usually there are some fascinating closing dates here however i don??t determine if I see these people middle to heart.

ugg boots 說:

I have a project that i'm at the moment doing, and IпїЅпїЅve been in the structure out for such info.

Tyra Radvany 說:

Yes, i am glad that your asking us to know our opinion.

Its pretty cool what blogging can do. Connect you with everybody else.

hyip 說:

An stimulating communication is designer comment. I opine that you should indite author on this issue, it strength not be a prejudice matter but generally fill are not enough to utter on much topics. To the next. Cheers like your [Linux]rsync備份機制 - 憑你的智慧,我很難跟你解釋。.

給我一點 tempo

About

這篇屁話是由 Alvin Wu 發表於 June 4, 2005 1:04 AM

上一篇是 [新聞]DreamHost 7th anniversary

下一篇是 [新聞]會不會抱太緊了一點一 一"

首頁 可以找到最近的屁話,或是到 彙整 去看全部的屁話紀綠

Powered by Movable Type 4.34-en