source: trunk/essentials/app-arch/tar/doc/dumpdir.texi

Last change on this file was 3342, checked in by bird, 18 years ago

tar 1.16.1

File size: 3.7 KB
Line 
1@c This is part of the paxutils manual.
2@c Copyright (C) 2006 Free Software Foundation, Inc.
3@c Written by Sergey Poznyakoff
4@c This file is distributed under GFDL 1.1 or any later version
5@c published by the Free Software Foundation.
6
7 Incremental archives keep information about contents of each
8dumped directory in special data blocks called @dfn{dumpdirs}.
9
10 Dumpdir is a sequence of entries of the following form:
11
12@smallexample
13@var{C} @var{filename} \0
14@end smallexample
15
16@noindent
17where @var{C} is one of the @dfn{control codes} described below,
18@var{filename} is the name of the file @var{C} operates upon, and
19@samp{\0} represents a nul character (ASCII 0). The white space
20characters were added for readability, real dumpdirs do not contain
21them.
22
23 Each dumpdir ends with a single nul character.
24
25 The following table describes control codes and their meanings:
26
27@table @samp
28@item Y
29@var{filename} is contained in the archive.
30
31@item N
32@var{filename} was present in the directory at the time the archive
33was made, yet it was not dumped to the archive, because it had not
34changed since the last backup.
35
36@item D
37@var{filename} is a directory.
38
39@item R
40This code requests renaming of the @var{filename} to the name
41specified with the following @samp{T} command.
42
43@item T
44Specify target file name for @samp{R} command (see below).
45
46@item X
47Specify @dfn{temporary directory} name for a rename operation (see below).
48@end table
49
50 Codes @samp{Y}, @samp{N} and @samp{D} require @var{filename} argument
51to be a relative file name to the directory this dumpdir describes,
52whereas codes @samp{R}, @samp{T} and @samp{X} require their argument
53to be an absolute file name.
54
55 The three codes @samp{R}, @samp{T} and @samp{X} specify a
56@dfn{renaming operation}. In the simplest case it is:
57
58@smallexample
59R@file{source}\0T@file{dest}\0
60@end smallexample
61
62@noindent
63which means ``rename file @file{source} to file @file{dest}''.
64
65 However, there are cases that require using a @dfn{temporary
66directory}. For example, consider the following scenario:
67
68@enumerate 1
69@item
70Previous run dumped a directory @file{foo} which contained the
71following three directories:
72
73@smallexample
74a
75b
76c
77@end smallexample
78
79@item
80They were renamed @emph{cyclically}, so that:
81
82@example
83@file{a} became @file{b}
84@file{b} became @file{c}
85@file{c} became @file{a}
86@end example
87
88@item
89New incremental dump was made.
90@end enumerate
91
92 This case cannot be handled by three successive renames, since
93renaming @file{a} to @file{b} will destroy existing directory.
94To handle such case a temporary directory is required. @GNUTAR{}
95will create the following dumpdir (newlines have been added for
96readability):
97
98@smallexample
99@group
100Xfoo\0
101Rfoo/a\0T\0
102Rfoo/b\0Tfoo/c\0
103Rfoo/c\0Tfoo/a\0
104R\0Tfoo/a\0
105@end group
106@end smallexample
107
108 The first command, @samp{Xfoo\0}, instructs the extractor to create a
109temporary directory in the directory @file{foo}. Second command,
110@samp{Rfoo/aT\0}, says ``rename file @file{foo/a} to the temporary
111directory that has just been created'' (empty file name after a
112command means use temporary directory). Third and fourth commands
113work as usual, and, finally, the last command, @samp{R\0Tfoo/a\0}
114tells tar to rename the temporary directory to @file{foo/a}.
115
116 The exact placement of a dumpdir in the archive depends on the
117archive format (@pxref{Formats}):
118
119@itemize
120@item PAX archives
121
122In PAX archives, dumpdir is stored in the extended header of the
123corresponding directory, in variable @code{GNU.dumpdir}.
124
125@item GNU and old GNU archives
126
127These formats implement special header type @samp{D}, which is similar
128to ustar header @samp{5} (directory), except that it precedes a data
129block containing the dumpdir.
130@end itemize
131
132@c End of dumpdir.texi
Note: See TracBrowser for help on using the repository browser.