📄 0580backup.htm
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>
<html lang="zh-TW">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
<meta name="Author" content="VBird, 鸟哥" >
<meta name="Description" content="浅谈备份策略啊!" >
<title>鸟哥的 Linux 私房菜 -- 浅谈备份策略</title>
<style type="text/css">
body {
background-color: #D3D3D3;
color: #000000;
background-attachment:fixed ;
}
body,th,td,input,select,textarea,select,checkbox {
font-family: '新细明体', 'Times New Roman', serif;
font-size: 11pt ;
}
a:link {text-decoration: none; color: blue}
a:visited {text-decoration: none; color: blue}
a:active {text-decoration: none; color: blue}
a:hover {text-decoration: underline; color: #ff0000}
table.head1 {width:100%; background-color: #FFCCCC;
border-style:groove;border-width:5px;border-color: #FFCCCC; margin:0;
padding: 5px 5px}
td.head1 {font: 10pt "新细明体", serif; color: #000099; }
td.info1 {font: 11pt "新细明体", serif; color: #000066; text-align:center; width:14%}
td.info2 {font: 11pt "新细明体", serif; color: #000066; text-align:center; width:12%}
*.info21 {font: 11pt "新细明体", serif; color: #000066; }
*.info22 {font: 11pt "新细明体", serif; color: blue ; }
*.info23 {font: 11pt "新细明体", serif; color: green ; }
td.info3 {font: 11pt "新细明体", serif; color: #000066; text-align:justify}
*.text_head0 {font-size:18pt; font-family:'标楷体','Times New Roman','Times', serif; }
*.text_head_en {font-size:18pt; font-family:'Times New Roman','Times', serif; }
*.text_h1 {font: 15pt "新细明体", serif; color: #0000BB; font-weight: bold }
*.text_h2 {font: 13pt "新细明体", serif; color: #0000BB; font-weight: bold }
*.text_import1 {font: 11pt "新细明体", serif; color: #000088; font-weight: bold }
*.text_import2 {font: 11pt "新细明体", serif; color: #000088; font-weight: normal}
*.text_vbird {font: 11pt "新细明体", serif; color: #000088; font-weight: normal;
font-style: italic;}
*.text_history {font: 10pt "新细明体", serif; color: #000066; }
*.text_date {font: 10pt "新细明体", serif; color: #3333FF; }
*.block1 {padding: 10px 20px 10px 25px; text-align:left }
*.block2 {padding: 10px 0px 10px 25px; text-align:left }
table.term2 {width: 350px; background-color: #000000;
border-style:groove;border-width:3px;border-color: #FFCCCC; margin:10px 0px;}
table.term {width: 580px; background-color: #000000;
border-style:groove;border-width:3px;border-color: #FFCCCC; margin:10px 0px;}
td.term {font: 10pt "细明体", Fixedsys, serif; color: #FFFFFF; }
*.term_hd {font: 10pt "细明体", Fixedsys, serif; color: #BBBBBB; }
*.term_note {font: 10pt "细明体", Fixedsys, serif; color: #777777; font-weight: normal }
*.term_note_b {font: 10pt "细明体", Fixedsys, serif; color: #FF77FF; font-weight: bolder }
*.term_command {font: 10pt "细明体", Fixedsys, serif; color: yellow ; font-weight: bolder }
*.term_write {font: 10pt "细明体", Fixedsys, serif; color: yellow ; font-weight: normal }
*.term_say {font: 10pt "细明体", Fixedsys, serif; color: #FF6666; font-weight: normal }
</style>
</head>
<body style="margin:0; padding:0">
<center>
<!-- 这里是关于页首按钮处的按钮程式 -->
<div style="text-align:center">
<span style="font-weight:bolder; color:#3333FF"><span class="text_head0">鸟哥的<span class="text_head_en">
Linux </span>私房菜</span></span><br />
<span style="color:#000080">为取得较佳浏览结果,请爱用 <a href="http://moztw.org" target="_blank">firefox</a>
浏览本网页</span><br />
<a href="http://linux.vbird.org/" target="_blank"
onmouseover="document.head_icon1.src='../images/icon_VBird_on.jpg'"
onfocus="document.head_icon1.src='../images/icon_VBird_on.jpg'"
onmouseout="document.head_icon1.src='../images/icon_VBird_off.jpg'">
<img alt="前往鸟哥的 Linux 私房菜馆首页" title="前往鸟哥的 Linux 私房菜馆首页" name="head_icon1"
src="../images/icon_VBird_off.jpg" border="0" /></a>
<a target="_blank" href="http://linux.vbird.org/linux_basic"
onmouseover="document.head_icon2.src='../images/icon_basic_on.jpg'"
onfocus="document.head_icon2.src='../images/icon_basic_on.jpg'"
onmouseout="document.head_icon2.src='../images/icon_basic_off.jpg'">
<img src="../images/icon_basic_off.jpg" border="0"
alt="前往 Linux 基础文件,新手请从头学起"
title="前往 Linux 基础文件,新手请从头学起" name="head_icon2" /></a>
<a target="_blank" href="http://linux.vbird.org/linux_server"
onmouseover="document.head_icon3.src='../images/icon_server_on.jpg'"
onfocus="document.head_icon3.src='../images/icon_server_on.jpg'"
onmouseout="document.head_icon3.src='../images/icon_server_off.jpg'">
<img src="../images/icon_server_off.jpg" border="0"
alt="前往 Linux 架站文件,网路基础那章节请务必参考!"
title="前往 Linux 架站文件,网路基础那章节请务必参考!" name="head_icon3" /></a>
<a target="_blank" href="http://linux.vbird.org/linux_security"
onmouseover="document.head_icon4.src='../images/icon_security_on.jpg'"
onfocus="document.head_icon4.src='../images/icon_security_on.jpg'"
onmouseout="document.head_icon4.src='../images/icon_security_off.jpg'">
<img src="../images/icon_security_off.jpg" border="0"
alt="前往『网路安全』相关文件网页" title="前往『网路安全』相关文件网页" name="head_icon4" /></a>
<a href="http://phorum.vbird.org" target="_blank"
onmouseover="document.head_icon5.src='../images/icon_forum_on.jpg'"
onfocus="document.head_icon5.src='../images/icon_forum_on.jpg'"
onmouseout="document.head_icon5.src='../images/icon_forum_off.jpg'">
<img src="../images/icon_forum_off.jpg" border="0"
alt="前往 Linux 新手讨论区,发问前务必查阅发文规则"
title="前往 Linux 新手讨论区,发问前务必查阅发文规则" name="head_icon5" /></a>
<a target="_blank" href="http://linux.vbird.org/adsl"
onmouseover="document.head_icon6.src='../images/icon_adsl_on.jpg'"
onfocus="document.head_icon6.src='../images/icon_adsl_on.jpg'"
onmouseout="document.head_icon6.src='../images/icon_adsl_off.jpg'">
<img src="../images/icon_adsl_off.jpg" border="0"
alt="前往『ADSL连线分享』相关文件网页" title="前往『ADSL连线分享』相关文件网页" name="head_icon6" /></a>
<a href="http://www.study-area.org" target="_blank"
onmouseover="document.head_icon7.src='../images/icon_study-area.jpg'"
onfocus="document.head_icon7.src='../images/icon_study-area.jpg'"
onmouseout="document.head_icon7.src='../images/icon_study-area.jpg'">
<img src="../images/icon_study-area.jpg" border="0"
alt="前往 Study Area 网站" title="前往 Study Area 网站" name="head_icon7" /></a>
<br />
</div>
<table summary="本文内容的排版" style="width:750px;
background-image:url('../images/VBirdLinux.jpg');
background-attachment:fixed;" border="0" cellspacing="0" cellpadding="0">
<tr><td style="width:16px; height:16px; background-image:url('../images/border-top-left.jpg');
font-size:6px"> </td>
<td style="width:718px; height:16px; font-size:6px;
background-image:url('../images/border-top-center.jpg')"> </td>
<td style="width:16px; height:16px; background-image:url('../images/border-top-right.jpg');
font-size:6px"> </td></tr>
<tr><td style="width:16px; font-size:6px;
background-image:url('../images/border-middle-left.jpg')"> </td>
<td width="718">
<!-- 本文的档头部分 -->
<div style="text-align:center">
<a href="0580backup.php">
<span class="text_head0"><span class="text_head_en"> Linux </span>备份策略</span></a><br />
</div>
<div style="text-align:left">
<a href="0580backup.php?thisscreen=800x600"><!--切换解析度为 800x600--></a>
</div>
<div style="text-align:right">
<span class="text_history">最近更新日期∶2005/10/25</span>
</div>
<!-- 本文的档头部分 -->
<table class="head1" summary="排版∶文章档头的说明"><tr><td class="head1">
万一不幸你的 Linux 被骇客入侵了、或是你的 Linux 系统由于硬体关系 ( 不论是天灾还是人祸 )
而挂掉了!这个时候,请问如何快速的回复你的系统呢?呵呵!当然棉,如果有备份资料的话,
那么回复系统所花费的时间与成本将降低相当的多!平时最好就养成备份的习惯,
以免突然之间的手足无措!此外,哪些档案最需要备份呢?又,备份是需要完整的备份还是仅备份重要资料即可?
嗯!确实需要考虑看看呦!
</td></tr></table><br>
<!-- 本文的连结区部分 -->
<div class=block1>
<span class="text_h1">
1. <a href="#who_need_backup">谁需要备份资料</a><br>
2. <a href="#what_data_must_backup">哪些 Linux 资料具有备份的意义</a><br>
3. <a href="#what_media">选择的备份装置</a><br>
4. <a href="#backup_type">备份的种类</a>∶ <span class=text_h2><a href="#backup_all">完整备份(full backup)</a>,
<a href="#backup_part">部分备份(Implement backup)</a></span><br>
5. <a href="#backup_tools">备份的工具选择</a>∶ tar, dd, cpio...<br>
6. <a href="#VBird_strategy">VBird 的备份策略与 scripts</a>∶<br>
<span class=text_h2>
6.1 <a href="#all_back">系统备份</a><br>
6.2 <a href="#daily">每日备份</a><br>
6.3 <a href="#remote">远端备份</a><br>
</span>
7. <a href="#FAQ">本章习题练习</a><br>
<span class=text_h2>
8. <a href="http://phorum.vbird.org/viewtopic.php?t=23896"
target="_blank">针对本文的建议∶http://phorum.vbird.org/viewtopic.php?t=23896</a>
</span>
</span>
</div>
<!-- 本文的正式部分 -->
<hr><a NAME="who_need_backup"></a><img src="images/penguin-m.gif" alt="大标题的图示" height="34" width="25" align="middle" /><span class=text_h1>谁需要备份资料</span><br>
<div class=block1>
前面的章节我们提到了相当多的 Linux 系统基础,这个时候我们再来谈一谈∶『
<span class=text_import2>若您的系统由于不预期的伤害,导致系统发生错误,该如何修复?</span>
』这可是个相当大的问题呀!怎么说呢?又什么叫做『<span class=text_import2>不预期的伤害</span>?』
好了,假如您的 Linux 系统上面某些 Internet 的服务套件是最新的!也意味著可能是『相对最安全的』,
但是,这个世界目前是闲人相当的多的,你不知道什么时候会有所谓的『骇客软体』被提供出来,万一你在
Internet 上面的服务套件被入侵,导致你的 Linux 系统全毁,这个时候怎么办?!<br><br>
『<span class=text_import2>重新安装就好啦</span>!』或许您会这么说,但是,像鸟哥管理的几个网站的资料,尤其是
MySQL 资料库的资料,这些都是弥足珍贵的经验资料,万一被损毁而就不回来的时候,不是很可惜吗?
这个还好哩,万一您是某家银行的话,呵呵!那么资料的损毁可就不是能够等闲视之的!!
关系的可是数千甚至上万人的身家财产!!这就是备份的重要性了!他可以最起码的稍微保障我们的资料有另外一份
copy 的备援以达到『<span class=text_import2>安全回复</span>』的基本要求!<br><br>
如果是针对个人资料的话,那么在一般桌上型电脑中,Norton 的『 Ghost 』应该算是一套好到不行的备份大师了!
最主要是 Ghost 可以针对整个 partition 来进行备份,所以棉,我们可以将 Windows 系统当中的整个 C
或者是整个 D 槽完整的备份下来。甚至在还原方面也是非常的快速,而且操作简便!
另外,由于个人桌上型电脑所使用的资料量通常不大,所以当
ghost 完成之后,通常只要将资料烧录到光碟片当中,大约只要一至两片的光碟片也就绰绰有馀棉!
那么将光碟片保存好,这就是最简易的资料备份模式棉!
此外,由于个人的资料变动性不大,所以资料的备份频率方面也不需要非常的频繁!<br><br>
但是,万一您的主机有提供 Internet 方面的服务呢?又该如何备份啊?
举个例子来说,像是我们 Study Area 团队的讨论区网站 <a href="http://phorum.study-area.org"
target="_blank">http://phorum.study-area.org</a> 提供的是类似 BBS 的讨论文章,
虽然资料量不大,但是由于讨论区的文件是天天在增加的,每天都有相当多的资讯流入,
由于某些资讯都是属于重要的人物之留言,这个时候,我们能够让机器死掉吗?<br><br>
再提到 2002 年左右鸟哥的讨论区曾经挂点的问题,以及 2003 年初
Study-Area 讨论区挂点的问题,讨论区一旦挂点的话,该资料库内容如果损毁到无法救回来,
嘿嘿!要晓得讨论区可不是一个人的心血耶!有的时候(像
Study-Area 讨论区)是一群热心 Linux 的朋友们互相建立交流起来的资料流通网,如果死掉了,
那么不是让这些热血青年的热情付之一炬了吗?!所以棉,建立备份的策略是相当的重要的。<br><br>
基本上,『<span class=text_import1>电脑是一个相当不可靠的机器</span>』这句话在大部分的时间内还是成立的!
常常会听到说『要电脑正常的工作,最重要的是要去拜拜!』嘿嘿!不要笑!这还是真的哩!
尤其是在日前一些电脑周边硬体的生产良率 ( 就是将硬体产生出来之后,经过测试,
发现可正常工作的与不能正常工作的硬体总数之比值
) 越来越差的情况之下,电脑的不稳定状态实在是越来越严重了!<br><br>
举个例子来说,鸟哥曾经同时买过同一厂牌的
IxM 30GB 硬碟三颗,回来之后经过一个星期,嘿嘿!挂掉了两颗!其中一颗是有坏轨,另外一颗是『完全死掉』,
拿去公司要求修理,结果呢?嗯!店家直接拿了一棵新的给我,害我吓一跳,店家的工程师说
『唉呀!目前这个牌子的良率太差了,所以代理商为了怕麻烦,都会直接拿新的替换给我们啦!』
要晓得的是,当初那一颗完全死掉的硬碟,是我用来备份我的主机资料的....
好在当时我将备份的资料放在三四个地方,还好....<br><br>
所以棉!由于电脑 ( 尤其是目前的电脑,操作频率太高、硬体良率太差、使用者操作习惯不良、
『某些』作业系统的当机率太高.... ) 的稳定性较差,所以棉!备份的工作就越来越重要了!<br><br>
那么一般我们在备份时考虑的因素有哪些呢?
<ol>
<li><span class=text_import1>备份哪些档案∶</span><br>
例如在帐号管理那一篇当中,我们知道最起码主机的帐号资讯在 /etc/* 及 /home/* 等等档案都是重要的!</li><br>
<li><span class=text_import1>选择什么备份的媒介∶</span><br>
是可读写光碟、另一棵硬碟、同一颗硬碟的不同 partition、还是使用网路备援系统?
哪一种的速度最快,最便宜,可将资料保存最久?</li><br>
<li><span class=text_import1>考虑备份的方式∶</span><br>
是完全备份(类似 ghost)还是部分备份即可?</li><br>
<li><span class=text_import1>备份的频率∶</span><br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -