?? node95.html
字號:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds --><HTML><HEAD><TITLE>Making backups with tar</TITLE><META NAME="description" CONTENT="Making backups with tar"><META NAME="keywords" CONTENT="sag"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><LINK REL=STYLESHEET HREF="sag.css"></HEAD><BODY LANG="EN" > <A NAME="tex2html1496" HREF="node96.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1494" HREF="node94.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1488" HREF="node94.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1498" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1499" HREF="node108.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR><B> Next:</B> <A NAME="tex2html1497" HREF="node96.html">Restoring files with tar</A><B>Up:</B> <A NAME="tex2html1495" HREF="node94.html">Simple backups</A><B> Previous:</B> <A NAME="tex2html1489" HREF="node94.html">Simple backups</A><BR> <P><A NAME="2699"> </A><H2><A NAME="SECTION001041000000000000000">用<tt>tar</tt>備份</A></H2><P>一個全備份可以很容易地用<tt>tar</tt><A NAME="2701"> </A>實現: <BLOCKQUOTE> <TT># tar -create -file /dev/ftape /usr/src <BR> tar: Removing leading / from absolute path names in the archive <BR> # </TT></BLOCKQUOTE>上面的例子使用GNU版本的<tt>tar</tt><A NAME="2703"> </A>及其長選項名。傳統版本的<tt>tar</tt><A NAME="2705"> </A>只理解單字符選項。GNU版還能處理一盤磁帶或一張磁盤不能容納的備份,及很長的路徑名;這不是所有傳統的版本能作到的。(Linux只使用GNU <tt>tar</tt><A NAME="2707"> </A>。)<P>如果你的備份一盤磁帶不能容納,你需要使用<tt>-multi-volume</tt> (<tt>-M</tt>)選項: <BLOCKQUOTE> <TT># tar -cMf /dev/fd0H1440 /usr/src <BR> tar: Removing leading / from absolute path names in the archive <BR> Prepare volume #2 for /dev/fd0H1440 and hit return: <BR> # </TT></BLOCKQUOTE>注意開始備份前要格式化所有軟盤,或在<tt>tar</tt><A NAME="2709"> </A>需要新軟盤時用另一個虛擬控制臺或虛擬終端格式化它。<P>備份完后,應該檢查它是否完好,用<tt>-compare</tt> (<tt>-d</tt>)選項: <BLOCKQUOTE> <TT># tar -compare -verbose -f /dev/ftape <BR> usr/src/ <BR> usr/src/linux <BR> usr/src/linux-1.2.10-includes/ <BR> .... <BR> # </TT></BLOCKQUOTE>失敗的備份檢查意味著如果你丟失了原始數據,備份也無法恢復。<P>增量備份可用帶<tt>-newer</tt> (<tt>-N</tt>)選項的<tt>tar</tt><A NAME="2711"> </A>來實現: <BLOCKQUOTE> <TT># tar -create -newer '8 Sep 1995' -file /dev/ftape /usr/src -verbose <BR> tar: Removing leading / from absolute path names in the archive <BR> usr/src/ <BR> usr/src/linux-1.2.10-includes/ <BR> usr/src/linux-1.2.10-includes/include/ <BR> usr/src/linux-1.2.10-includes/include/linux/ <BR> usr/src/linux-1.2.10-includes/include/linux/modules/ <BR> usr/src/linux-1.2.10-includes/include/asm-generic/ <BR> usr/src/linux-1.2.10-includes/include/asm-i386/ <BR> usr/src/linux-1.2.10-includes/include/asm-mips/ <BR> usr/src/linux-1.2.10-includes/include/asm-alpha/ <BR> usr/src/linux-1.2.10-includes/include/asm-m68k/ <BR> usr/src/linux-1.2.10-includes/include/asm-sparc/ <BR> usr/src/patch-1.2.11.gz <BR> # </TT></BLOCKQUOTE>不幸的是,<tt>tar</tt><A NAME="2713"> </A>不能知道一個文件的i節點信息變化,例如,文件的權限位變化,或文件名變化。這可用<tt>find</tt><A NAME="2715"> </A>命令和比較當前文件系統狀態和先前備份的文件列表。用于此的Scripts和程序可以在Linux FTP站點上找到。<P><HR><A NAME="tex2html1496" HREF="node96.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1494" HREF="node94.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1488" HREF="node94.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1498" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1499" HREF="node108.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR><B> Next:</B> <A NAME="tex2html1497" HREF="node96.html">Restoring files with tar</A><B>Up:</B> <A NAME="tex2html1495" HREF="node94.html">Simple backups</A><B> Previous:</B> <A NAME="tex2html1489" HREF="node94.html">Simple backups</A><P><ADDRESS><I>Lars Wirzenius <BR>Sun Jun 29 13:31:22 EEST 1997</I></ADDRESS></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -