blob: a811e6c3dd98583fb9b0f64fa13278842e46a254 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
<!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>Restoring files with tar</TITLE>
<META NAME="description" CONTENT="Restoring files 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="tex2html1601" HREF="node103.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1599" HREF="node100.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1595" HREF="node101.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1603" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1604" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1602" HREF="node103.html">Multilevel backups</A>
<B>Up:</B> <A NAME="tex2html1600" HREF="node100.html">Simple backups</A>
<B> Previous:</B> <A NAME="tex2html1596" HREF="node101.html">Making backups with tar</A>
<BR> <P>
<A NAME="3072"> </A><H2><A NAME="SECTION001142000000000000000">Restoring files with <tt>tar</tt></A></H2>
<P>
The <tt>-extract</tt> (<tt>-x</tt>) option for <tt>tar</tt><A NAME="3074"> </A> extracts files:
<BLOCKQUOTE> <TT>
# tar -extract -same-permissions -verbose -file /dev/fd0H1440 <BR>
usr/src/ <BR>
usr/src/linux <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/hdreg.h <BR>
usr/src/linux-1.2.10-includes/include/linux/kernel.h <BR>
... <BR>
#
</TT></BLOCKQUOTE>
You also extract only specific files or directories (which includes
all their files and subdirectories) by naming on the command line:
<BLOCKQUOTE> <TT>
# tar xpvf /dev/fd0H1440 usr/src/linux-1.2.10-includes/include/linux/hdreg.h <BR>
usr/src/linux-1.2.10-includes/include/linux/hdreg.h <BR>
#
</TT></BLOCKQUOTE>
Use the <tt>-list</tt> (<tt>-t</tt>) option, if you just want to see
what files are on a backup volume:
<BLOCKQUOTE> <TT>
# tar -list -file /dev/fd0H1440 <BR>
usr/src/ <BR>
usr/src/linux <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/hdreg.h <BR>
usr/src/linux-1.2.10-includes/include/linux/kernel.h <BR>
... <BR>
#
</TT></BLOCKQUOTE>
Note that <tt>tar</tt><A NAME="3076"> </A> always reads the backup volume sequentially,
so for large volumes it is rather slow. It is not possible,
however, to use random access database techniques when using
a tape drive or some other sequential medium.
<P>
<tt>tar</tt><A NAME="3078"> </A> doesn't handle deleted files properly. If you need
to restore a filesystem from a full and an incremental backup,
and you have deleted a file between the two backups, it will
exist again after you have done the restore. This can be a
big problem, if the file has sensitive data that should no
longer be available.
<P>
<BR> <HR>
<P><ADDRESS>
<I>Lars Wirzenius <BR>
Sat Nov 15 02:32:11 EET 1997</I>
</ADDRESS>
</BODY>
</HTML>
|