[Linux]rsync備份機制
以下以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備份機制 的文章如下 :

這個是你提到的兩台同步資料的方法嗎?
是滴
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.
Not so bad !
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!
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?
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.
Thanks a bunch !:)
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.
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
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.
I have a project that i'm at the moment doing, and IпїЅпїЅve been in the structure out for such info.
Yes, i am glad that your asking us to know our opinion.
Its pretty cool what blogging can do. Connect you with everybody else.
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備份機制 - æ†‘ä½ çš„æ™ºæ…§ï¼Œæˆ‘å¾ˆé›£è·Ÿä½ è§£é‡‹ã€‚.