summaryrefslogtreecommitdiffstats
path: root/doc/tarlz.info
blob: 140336bca1370f63e5ceb2037d8cd07ad25ee8f7 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
This is tarlz.info, produced by makeinfo version 4.13+ from tarlz.texi.

INFO-DIR-SECTION Data Compression
START-INFO-DIR-ENTRY
* Tarlz: (tarlz).               Archiver with multimember lzip compression
END-INFO-DIR-ENTRY


File: tarlz.info,  Node: Top,  Next: Introduction,  Up: (dir)

Tarlz Manual
************

This manual is for Tarlz (version 0.4, 23 April 2018).

* Menu:

* Introduction::           Purpose and features of tarlz
* Invoking tarlz::         Command line interface
* Examples::               A small tutorial with examples
* Problems::               Reporting bugs
* Concept index::          Index of concepts


   Copyright (C) 2013-2018 Antonio Diaz Diaz.

   This manual is free documentation: you have unlimited permission to
copy, distribute and modify it.


File: tarlz.info,  Node: Introduction,  Next: Invoking tarlz,  Prev: Top,  Up: Top

1 Introduction
**************

Tarlz is a small and simple implementation of the tar archiver. By
default tarlz creates, lists and extracts archives in the 'ustar' format
compressed with lzip on a per file basis. Tarlz can append files to the
end of such compressed archives.

   Each tar member is compressed in its own lzip member, as well as the
end-of-file blocks. This same method works for any tar format (gnu,
ustar, posix) and is fully backward compatible with standard tar tools
like GNU tar, which treat the resulting multimember tar.lz archive like
any other tar.lz archive.

   Tarlz can create tar archives with four levels of compression
granularity; per file, per directory, appendable solid, and solid.

   Tarlz is intended as a showcase project for the maintainers of real
tar programs to evaluate the format and perhaps implement it in their
tools.

   The diagram below shows the correspondence between tar members
(formed by a header plus optional data) in the tar archive and lzip
members in the resulting multimember tar.lz archive: *Note File format:
(lzip)File format.

tar
+========+======+========+======+========+======+========+
| header | data | header | data | header | data |   eof  |
+========+======+========+======+========+======+========+

tar.lz
+===============+===============+===============+========+
|     member    |     member    |     member    | member |
+===============+===============+===============+========+

Of course, compressing each file (or each directory) individually is
less efficient than compressing the whole tar archive, but it has the
following advantages:

   * The resulting multimember tar.lz archive can be decompressed in
     parallel with plzip, multiplying the decompression speed.

   * New members can be appended to the archive (by removing the eof
     member) just like to an uncompressed tar archive.

   * It is a safe posix-style backup format. In case of corruption,
     tarlz can extract all the undamaged members from the tar.lz
     archive, skipping over the damaged members, just like the standard
     (uncompressed) tar. Moreover, lziprecover can be used to recover at
     least part of the contents of the damaged members.

   * A multimember tar.lz archive is usually smaller than the
     corresponding solidly compressed tar.gz archive, except when
     individually compressing files smaller than about 32 KiB.


File: tarlz.info,  Node: Invoking tarlz,  Next: Examples,  Prev: Introduction,  Up: Top

2 Invoking tarlz
****************

The format for running tarlz is:

     tarlz [OPTIONS] [FILES]

On archive creation or appending, tarlz removes leading and trailing
slashes from file names, as well as file name prefixes containing a
'..' component. On extraction, archive members containing a '..'
component are skipped.

   tarlz supports the following options:

'-h'
'--help'
     Print an informative help message describing the options and exit.

'-V'
'--version'
     Print the version number of tarlz on the standard output and exit.

'-c'
'--create'
     Create a new archive.

'-C DIR'
'--directory=DIR'
     Change to directory DIR. When creating or appending, the position
     of each '-C' option in the command line is significant; it will
     change the current working directory for the following FILES until
     a new '-C' option appears in the command line. When extracting, all
     the '-C' options are executed in sequence before starting the
     extraction. Listing ignores any '-C' options specified. DIR is
     relative to the then current working directory, perhaps changed by
     a previous '-C' option.

'-f ARCHIVE'
'--file=ARCHIVE'
     Use archive file ARCHIVE. '-' used as an ARCHIVE argument reads
     from standard input or writes to standard output.

'-q'
'--quiet'
     Quiet operation. Suppress all messages.

'-r'
'--append'
     Append files to the end of an archive. The archive must be a
     regular (seekable) file compressed as a multimember lzip file, and
     the two end-of-file blocks plus any zero padding must be contained
     in the last lzip member of the archive. First this last member is
     removed, then the new members are appended, and then a new
     end-of-file member is appended to the archive. Exit with status 0
     without modifying the archive if no FILES have been specified.
     tarlz can't append files to an uncompressed tar archive.

'-t'
'--list'
     List the contents of an archive.

'-v'
'--verbose'
     Verbosely list files processed.

'-x'
'--extract'
     Extract files from an archive.

'-0 .. -9'
     Set the compression level. The default compression level is '-6'.

'--asolid'
     When creating or appending to a compressed archive, use appendable
     solid compression. All the files being added to the archive are
     compressed into a single lzip member, but the end-of-file blocks
     are compressed into a separate lzip member. This creates a solidly
     compressed appendable archive.

'--dsolid'
     When creating or appending to a compressed archive, use solid
     compression for each directory especified in the command line. The
     end-of-file blocks are compressed into a separate lzip member. This
     creates a compressed appendable archive with a separate lzip
     member for each top-level directory.

'--solid'
     When creating or appending to a compressed archive, use solid
     compression. The files being added to the archive, along with the
     end-of-file blocks, are compressed into a single lzip member. The
     resulting archive is not appendable. No more files can be later
     appended to the archive without decompressing it first.

'--group=GROUP'
     When creating or appending, use GROUP for files added to the
     archive. If GROUP is not a valid group name, it is decoded as a
     decimal numeric group ID.

'--owner=OWNER'
     When creating or appending, use OWNER for files added to the
     archive. If OWNER is not a valid user name, it is decoded as a
     decimal numeric user ID.

'--uncompressed'
     With '--create', don't compress the created tar archive. Create an
     uncompressed tar archive instead.


   Exit status: 0 for a normal exit, 1 for environmental problems (file
not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or
invalid input file, 3 for an internal consistency error (eg, bug) which
caused tarlz to panic.


File: tarlz.info,  Node: Examples,  Next: Problems,  Prev: Invoking tarlz,  Up: Top

3 A small tutorial with examples
********************************

Example 1: Create a multimember compressed archive 'archive.tar.lz'
containing files 'a', 'b' and 'c'.

     tarlz -cf archive.tar.lz a b c


Example 2: Append files 'd' and 'e' to the multimember compressed
archive 'archive.tar.lz'.

     tarlz -rf archive.tar.lz d e


Example 3: Create a solidly compressed appendable archive
'archive.tar.lz' containing files 'a', 'b' and 'c'.  Then append files
'd' and 'e' to the archive.

     tarlz --asolid -cf archive.tar.lz a b c
     tarlz --asolid -rf archive.tar.lz d e


Example 4: Create a compressed appendable archive containing directories
'dir1', 'dir2' and 'dir3' with a separate lzip member per directory.
Then append files 'a', 'b', 'c', 'd' and 'e' to the archive, all of
them contained in a single lzip member.  The resulting archive
'archive.tar.lz' contains 5 lzip members (including the eof member).

     tarlz --dsolid -cf archive.tar.lz dir1 dir2 dir3
     tarlz --asolid -rf archive.tar.lz a b c d e


Example 5: Create a solidly compressed archive 'archive.tar.lz'
containing files 'a', 'b' and 'c'. Note that no more files can be later
appended to the archive without decompressing it first.

     tarlz --solid -cf archive.tar.lz a b c


Example 6: Extract all files from archive 'archive.tar.lz'.

     tarlz -xf archive.tar.lz


Example 7: Extract files 'a' and 'c' from archive 'archive.tar.lz'.

     tarlz -xf archive.tar.lz a c


Example 8: Copy the contents of directory 'sourcedir' to the directory
'targetdir'.

     tarlz -C sourcedir -c . | tarlz -C targetdir -x


File: tarlz.info,  Node: Problems,  Next: Concept index,  Prev: Examples,  Up: Top

4 Reporting bugs
****************

There are probably bugs in tarlz. There are certainly errors and
omissions in this manual. If you report them, they will get fixed. If
you don't, no one will ever know about them and they will remain unfixed
for all eternity, if not longer.

   If you find a bug in tarlz, please send electronic mail to
<lzip-bug@nongnu.org>. Include the version number, which you can find
by running 'tarlz --version'.


File: tarlz.info,  Node: Concept index,  Prev: Problems,  Up: Top

Concept index
*************

[index]
* Menu:

* bugs:                                  Problems.              (line 6)
* examples:                              Examples.              (line 6)
* getting help:                          Problems.              (line 6)
* introduction:                          Introduction.          (line 6)
* invoking:                              Invoking tarlz.        (line 6)
* options:                               Invoking tarlz.        (line 6)
* usage:                                 Invoking tarlz.        (line 6)
* version:                               Invoking tarlz.        (line 6)



Tag Table:
Node: Top223
Node: Introduction785
Node: Invoking tarlz3280
Node: Examples7278
Node: Problems8975
Node: Concept index9501

End Tag Table


Local Variables:
coding: iso-8859-15
End: