📄 ch20_02.htm
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 20] 20.2 Make Your Own Backups </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly & Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly & Associates, Inc."><METANAME="DC.date"CONTENT="1998-10-23T15:44:49Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="ch20_01.htm"TITLE="20. Backing Up Files"><LINKREL="prev"HREF="ch20_01.htm"TITLE="20.1 tar in a Nutshell "><LINKREL="next"HREF="ch20_03.htm"TITLE="20.3 How to Make Backups with a Local Tape Drive "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch20_01.htm"TITLE="20.1 tar in a Nutshell "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 20.1 tar in a Nutshell "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 20<BR>Backing Up Files</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch20_03.htm"TITLE="20.3 How to Make Backups with a Local Tape Drive "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 20.3 How to Make Backups with a Local Tape Drive "BORDER="0"></A></TD></TR></TABLE> <HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-0421">20.2 Make Your Own Backups </A></H2><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-21766"></A>As someone who has been an end user and a system administrator, I strongly believe that every user should understand the importance ofbackups.</P><BLOCKQUOTECLASS="note"><PCLASS="para"><STRONG>NOTE:</STRONG> If you have data that is important to you, you shouldhave a known backup.</P></BLOCKQUOTE><PCLASS="para">Accidents and oversights happen. Tapes can be damaged, lost, or mislabeled.Assume that your system administrator is top-notch.The best administrator can recover your lost data 99 percentof the time.There is still a small chance that the files you needmight not be recovered. Can you afford to duplicate months of effort 1 percent of the time?No.</P><PCLASS="para">An experienced user learns to be pessimistic. Typically, this important fact is learned the hard way.Perhaps a few hours are lost. Perhaps days. Sometimes monthsare lost.</P><PCLASS="para">Here are some common situations:</P><ULCLASS="itemizedlist"><LICLASS="listitem"><PCLASS="para">A user works on a file all day. At the end of the day, the fileis deleted by accident. The system manager cannot recover the file.A day's work has been lost.</P></LI><LICLASS="listitem"><PCLASS="para">A programmer tries to clean up a project directory.Instead of typing<CODECLASS="literal">rm *.o</CODE>the programmer types<CODECLASS="literal">rm * .o</CODE>and the entire directory is lost.</P></LI><LICLASS="listitem"><PCLASS="para">A user deletes a file by accident.After a few days, the user asks the system administrator to recoverthe file. The incremental backup system has re-used theonly tape the missing file was on.</P></LI><LICLASS="listitem"><PCLASS="para">A large project is archived on a magnetic tape and deletedfrom the disk. A year later, some of the information is needed.The tape has a bad block at the beginning. The system managermust learn how to recover data from a bad tape. The attempt is oftenunsuccessful. The information is lost forever, and must bere-created, at the cost of months of effort.</P></LI><LICLASS="listitem"><PCLASS="para">Someone breaks into a computer and accesses confidential information.</P></LI><LICLASS="listitem"><PCLASS="para">A fire breaks out in the computer room. The disks and<EMCLASS="emphasis">all</EM>of the backup tapes are lost. </P></LI></UL><PCLASS="para">Gulp! I scared myself.Excuse me for a few minutes while I load a tape...</P><PCLASS="para">Ah! I feel better now.As I was saying, being pessimistic has itsadvantages.</P><PCLASS="para">Making a backup is easy.Get a blank tape and put a label on it.Learn how to load it onto the tape drive.Then do the following:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>cd</B></CODE>% <CODECLASS="userinput"><B>tar c .</B></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">Take the tape off.Write-protect the tape (slide the tab, turn the knob, or take out the ring).That's all.</P><PCLASS="para">[Not quite!Bruce also points outthat you can get even more protection by using a version controlsystem like<SPANCLASS="link">SCCS (<ACLASS="linkend"HREF="ch20_12.htm"TITLE="Protecting Files with SCCS or RCS ">20.12</A>)</SPAN>or<SPANCLASS="link">RCS (<ACLASS="linkend"HREF="ch20_14.htm"TITLE="RCS Basics ">20.14</A>)</SPAN>to save every version of a file you areupdating frequently. -<EMCLASS="emphasis">TOR</EM> ]</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">BB</SPAN></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch20_01.htm"TITLE="20.1 tar in a Nutshell "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 20.1 tar in a Nutshell "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch20_03.htm"TITLE="20.3 How to Make Backups with a Local Tape Drive "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 20.3 How to Make Backups with a Local Tape Drive "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">20.1 tar in a Nutshell </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">20.3 How to Make Backups with a Local Tape Drive </TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed & awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -