]> Dogcows Code - chaz/tar/blobdiff - doc/tar.texi
Allow for size suffixes in -L and --record-size options.
[chaz/tar] / doc / tar.texi
index 9bca1ef7d16a6041a69534ff1b8f3ea006b3f210..52b774cbbf0354236f3a1f3915cc8565801434c9 100644 (file)
@@ -330,6 +330,10 @@ Using Less Space through Compression
 * gzip::                        Creating and Reading Compressed Archives
 * sparse::                      Archiving Sparse Files
 
+Creating and Reading Compressed Archives
+
+* lbzip2::  Using lbzip2 with @GNUTAR{}.
+
 Making @command{tar} Archives More Portable
 
 * Portable Names::              Portable Names
@@ -2684,6 +2688,30 @@ Creates a @acronym{POSIX.1-2001 archive}.
 
 @xref{Formats}, for a detailed discussion of these formats.
 
+@opsummary{full-time}
+@item --full-time
+This option instructs @command{tar} to print file times to their full
+resolution.  Usually this means 1-second resolution, but that depends
+on the underlying file system.  The @option{--full-time} option takes
+effect only when detailed output (verbosity level 2 or higher) has
+been requested using the @option{--verbose} option, e.g., when listing
+or extracting archives:
+
+@smallexample
+$ @kbd{tar -t -v --full-time -f archive.tar}
+@end smallexample
+
+@noindent
+or, when creating an archive:
+
+@smallexample
+$ @kbd{tar -c -vv --full-time -f archive.tar .}
+@end smallexample
+
+Notice, thar when creating the archive you need to specify
+@option{--verbose} twice to get a detailed output (@pxref{verbose
+tutorial}).
+
 @opsummary{group}
 @item --group=@var{group}
 
@@ -3125,10 +3153,13 @@ Specifies that @command{tar} should reblock its input, for reading
 from pipes on systems with buggy implementations.  @xref{Reading}.
 
 @opsummary{record-size}
-@item --record-size=@var{size}
+@item --record-size=@var{size}[@var{suf}]
 
 Instructs @command{tar} to use @var{size} bytes per record when accessing the
-archive.  @xref{Blocking Factor}.
+archive.  The argument can be suffixed with a @dfn{size suffix}, e.g.
+@option{--record-size=10K} for 10 Kilobytes.  @xref{size-suffixes},
+for a list of valid suffixes.   @xref{Blocking Factor}, for a detailed
+description of this option.
 
 @opsummary{recursion}
 @item --recursion
@@ -3278,11 +3309,15 @@ Alters the suffix @command{tar} uses when backing up files from the default
 @samp{~}.  @xref{backup}.
 
 @opsummary{tape-length}
-@item --tape-length=@var{num}
-@itemx -L @var{num}
+@item --tape-length=@var{num}[@var{suf}]
+@itemx -L @var{num}[@var{suf}]
 
 Specifies the length of tapes that @command{tar} is writing as being
-@w{@var{num} x 1024} bytes long.  @xref{Using Multiple Tapes}.
+@w{@var{num} x 1024} bytes long.  If optional @var{suf} is given, it
+specifies a multiplicative factor to be used instead of 1024.  For
+example, @samp{-L2M} means 2 megabytes.  @xref{size-suffixes}, for a
+list of allowed suffixes.  @xref{Using Multiple Tapes}, for a detailed
+discussion of this option.
 
 @opsummary{test-label}
 @item --test-label
@@ -8677,7 +8712,7 @@ For example:
 $ @kbd{tar cfz archive.tar.gz .}
 @end smallexample
 
-You can also let @GNUTAR{} select the compression program basing on
+You can also let @GNUTAR{} select the compression program based on
 the suffix of the archive file name. This is done using
 @option{--auto-compress} (@option{-a}) command line option. For
 example, the following invocation will use @command{bzip2} for
@@ -8742,34 +8777,9 @@ cannot append another @command{tar} archive to a compressed archive using
 @option{--concatenate} (@option{-A}).  Secondly, multi-volume
 archives cannot be compressed.
 
-The following table summarizes compression options used by @GNUTAR{}.
+The following options allow to select a particular compressor program:
 
 @table @option
-@anchor{auto-compress}
-@opindex auto-compress
-@item --auto-compress
-@itemx -a
-Select a compression program to use by the archive file name
-suffix.  The following suffixes are recognized:
-
-@multitable @columnfractions 0.3 0.6
-@headitem Suffix @tab Compression program
-@item @samp{.gz} @tab @command{gzip}
-@item @samp{.tgz} @tab @command{gzip}
-@item @samp{.taz} @tab @command{gzip}
-@item @samp{.Z} @tab @command{compress}
-@item @samp{.taZ} @tab @command{compress}
-@item @samp{.bz2} @tab @command{bzip2}
-@item @samp{.tz2} @tab @command{bzip2}
-@item @samp{.tbz2} @tab @command{bzip2}
-@item @samp{.tbz} @tab @command{bzip2}
-@item @samp{.lz} @tab @command{lzip}
-@item @samp{.lzma} @tab @command{lzma}
-@item @samp{.tlz} @tab @command{lzma}
-@item @samp{.lzo} @tab @command{lzop}
-@item @samp{.xz} @tab @command{xz}
-@end multitable
-
 @opindex gzip
 @opindex ungzip
 @item -z
@@ -8777,69 +8787,110 @@ suffix.  The following suffixes are recognized:
 @itemx --ungzip
 Filter the archive through @command{gzip}.
 
-You can use @option{--gzip} and @option{--gunzip} on physical devices
-(tape drives, etc.) and remote files as well as on normal files; data
-to or from such devices or remote files is reblocked by another copy
-of the @command{tar} program to enforce the specified (or default) record
-size.  The default compression parameters are used; if you need to
-override them, set @env{GZIP} environment variable, e.g.:
-
-@smallexample
-$ @kbd{GZIP=--best tar cfz archive.tar.gz subdir}
-@end smallexample
-
-@noindent
-Another way would be to avoid the @option{--gzip} (@option{--gunzip}, @option{--ungzip}, @option{-z}) option and run
-@command{gzip} explicitly:
-
-@smallexample
-$ @kbd{tar cf - subdir | gzip --best -c - > archive.tar.gz}
-@end smallexample
-
-@cindex corrupted archives
-About corrupted compressed archives: @command{gzip}'ed files have no
-redundancy, for maximum compression.  The adaptive nature of the
-compression scheme means that the compression tables are implicitly
-spread all over the archive.  If you lose a few blocks, the dynamic
-construction of the compression tables becomes unsynchronized, and there
-is little chance that you could recover later in the archive.
-
-There are pending suggestions for having a per-volume or per-file
-compression in @GNUTAR{}.  This would allow for viewing the
-contents without decompression, and for resynchronizing decompression at
-every volume or file, in case of corrupted archives.  Doing so, we might
-lose some compressibility.  But this would have make recovering easier.
-So, there are pros and cons.  We'll see!
-
-@opindex bzip2
+@opindex xz
 @item -J
 @itemx --xz
-Filter the archive through @code{xz}.  Otherwise like
-@option{--gzip}.
+Filter the archive through @code{xz}.
 
 @item -j
 @itemx --bzip2
-Filter the archive through @code{bzip2}.  Otherwise like @option{--gzip}.
+Filter the archive through @code{bzip2}.
 
 @opindex lzip
 @item --lzip
-Filter the archive through @command{lzip}.  Otherwise like @option{--gzip}.
+Filter the archive through @command{lzip}.
 
 @opindex lzma
 @item --lzma
-Filter the archive through @command{lzma}.  Otherwise like @option{--gzip}.
+Filter the archive through @command{lzma}.
 
 @opindex lzop
 @item --lzop
-Filter the archive through @command{lzop}.  Otherwise like
-@option{--gzip}.
+Filter the archive through @command{lzop}.
 
 @opindex compress
 @opindex uncompress
 @item -Z
 @itemx --compress
 @itemx --uncompress
-Filter the archive through @command{compress}.  Otherwise like @option{--gzip}.
+Filter the archive through @command{compress}.
+@end table
+
+When any of these options is given, @GNUTAR{} searches the compressor
+binary in the current path and invokes it.  The name of the compressor
+program is specified at compilation time using a corresponding
+@option{--with-@var{compname}} option to @command{configure}, e.g.
+@option{--with-bzip2} to select a specific @command{bzip2} binary.
+@xref{lbzip2}, for a detailed discussion.
+
+The output produced by @command{tar --help} shows the actual
+compressor names along with each of these options.
+
+You can use any of these options on physical devices (tape drives,
+etc.) and remote files as well as on normal files; data to or from
+such devices or remote files is reblocked by another copy of the
+@command{tar} program to enforce the specified (or default) record 
+size.  The default compression parameters are used.  Most compression
+programs allow to override these by setting a program-specific
+environment variable.  For example, when using @command{gzip} you can
+use @env{GZIP} as in the example below:
+
+@smallexample
+$ @kbd{GZIP=--best tar cfz archive.tar.gz subdir}
+@end smallexample
+
+@noindent
+Another way would be to use the @option{-I} option instead (see
+below), e.g.:
+
+@smallexample
+$ @kbd{tar -cf archive.tar.gz -I 'gzip --best' subdir}
+@end smallexample
+
+@noindent
+Finally, the third, traditional, way to achieve the same result is to
+use pipe:
+
+@smallexample
+$ @kbd{tar cf - subdir | gzip --best -c - > archive.tar.gz}
+@end smallexample
+
+@cindex corrupted archives
+About corrupted compressed archives: compressed files have no
+redundancy, for maximum compression.  The adaptive nature of the
+compression scheme means that the compression tables are implicitly
+spread all over the archive.  If you lose a few blocks, the dynamic
+construction of the compression tables becomes unsynchronized, and there
+is little chance that you could recover later in the archive.
+
+Another compression options provide a better control over creating
+compressed archives.  These are:
+
+@table @option
+@anchor{auto-compress}
+@opindex auto-compress
+@item --auto-compress
+@itemx -a
+Select a compression program to use by the archive file name
+suffix.  The following suffixes are recognized:
+
+@multitable @columnfractions 0.3 0.6
+@headitem Suffix @tab Compression program
+@item @samp{.gz} @tab @command{gzip}
+@item @samp{.tgz} @tab @command{gzip}
+@item @samp{.taz} @tab @command{gzip}
+@item @samp{.Z} @tab @command{compress}
+@item @samp{.taZ} @tab @command{compress}
+@item @samp{.bz2} @tab @command{bzip2}
+@item @samp{.tz2} @tab @command{bzip2}
+@item @samp{.tbz2} @tab @command{bzip2}
+@item @samp{.tbz} @tab @command{bzip2}
+@item @samp{.lz} @tab @command{lzip}
+@item @samp{.lzma} @tab @command{lzma}
+@item @samp{.tlz} @tab @command{lzma}
+@item @samp{.lzo} @tab @command{lzop}
+@item @samp{.xz} @tab @command{xz}
+@end multitable
 
 @opindex use-compress-program
 @item --use-compress-program=@var{prog}
@@ -8933,6 +8984,45 @@ The above is based on the following discussion:
   end up with less space on the tape.
 @end ignore
 
+@menu
+* lbzip2::  Using lbzip2 with @GNUTAR{}.
+@end menu
+
+@node lbzip2
+@subsubsection Using lbzip2 with @GNUTAR{}.
+@cindex lbzip2
+@cindex Laszlo Ersek
+  @command{Lbzip2} is a multithreaded utility for handling
+@samp{bzip2} compression, written by Laszlo Ersek.  It makes use of
+multiple processors to speed up its operation and in general works
+considerably faster than @command{bzip2}.  For a detailed description
+of @command{lbzip2} see @uref{http://freshmeat.net/@/projects/@/lbzip2} and
+@uref{http://www.linuxinsight.com/@/lbzip2-parallel-bzip2-utility.html,
+lbzip2: parallel bzip2 utility}.
+
+  Recent versions of @command{lbzip2} are mostly command line compatible
+with @command{bzip2}, which makes it possible to automatically invoke
+it via the @option{--bzip2} @GNUTAR{} command line option.  To do so,
+@GNUTAR{} must be configured with the @option{--with-bzip2} command
+line option, like this:
+
+@smallexample
+$ @kbd{./configure --with-bzip2=lbzip2 [@var{other-options}]}
+@end smallexample
+
+  Once configured and compiled this way, @command{tar --help} will show the
+following:
+
+@smallexample
+@group
+$ @kbd{tar --help | grep -- --bzip2}
+  -j, --bzip2                filter the archive through lbzip2
+@end group
+@end smallexample
+  
+@noindent
+which means that running @command{tar --bzip2} will invoke @command{lbzip2}.
+
 @node sparse
 @subsection Archiving Sparse Files
 @cindex Sparse Files
@@ -10262,8 +10352,27 @@ that may be larger than will fit on the medium used to hold it.
 
 @xopindex{tape-length, short description}
 @item -L @var{num}
-@itemx --tape-length=@var{num}
-Change tape after writing @var{num} x 1024 bytes.
+@itemx --tape-length=@var{size}[@var{suf}]
+Change tape after writing @var{size} units of data.  Unless @var{suf} is
+given, @var{size} is treated as kilobytes, i.e. @samp{@var{size} x
+1024} bytes.  The following suffixes alter this behavior:
+
+@float Table, size-suffixes
+@caption{Size Suffixes}
+@multitable @columnfractions 0.2 0.3 0.3
+@headitem Suffix @tab Units            @tab Byte Equivalent
+@item b          @tab Blocks           @tab @var{size} x 512
+@item B          @tab Kilobytes        @tab @var{size} x 1024
+@item c          @tab Bytes            @tab @var{size}
+@item G          @tab Gigabytes        @tab @var{size} x 1024^3
+@item K          @tab Kilobytes        @tab @var{size} x 1024
+@item k          @tab Kilobytes        @tab @var{size} x 1024
+@item M          @tab Megabytes        @tab @var{size} x 1024^2
+@item P          @tab Petabytes        @tab @var{size} x 1024^5
+@item T          @tab Terabytes        @tab @var{size} x 1024^4
+@item w          @tab Words            @tab @var{size} x 2
+@end multitable
+@end float
 
 This option might be useful when your tape drivers do not properly
 detect end of physical tapes.  By being slightly conservative on the
@@ -11071,15 +11180,26 @@ tape:
 @anchor{tape-length}
 @table @option
 @opindex tape-length
-@item --tape-length=@var{size}
-@itemx -L @var{size}
-Set maximum length of a volume.  The @var{size} argument should then
-be the usable size of the tape in units of 1024 bytes.  This option
-selects @option{--multi-volume} automatically.  For example:
+@item --tape-length=@var{size}[@var{suf}]
+@itemx -L @var{size}[@var{suf}]
+Set maximum length of a volume.  The @var{suf}, if given, specifies
+units in which @var{size} is expressed, e.g. @samp{2M} mean 2
+megabytes (@pxref{size-suffixes}, for a list of allowed size
+suffixes).  Without @var{suf}, units of 1024 bytes (kilobyte) are
+assumed.
+
+This option selects @option{--multi-volume} automatically.  For example:
 
 @smallexample
 $ @kbd{tar --create --tape-length=41943040 --file=/dev/tape @var{files}}
 @end smallexample
+
+@noindent
+or, which is equivalent:
+
+@smallexample
+$ @kbd{tar --create --tape-length=4G --file=/dev/tape @var{files}}
+@end smallexample
 @end table
 
 @anchor{change volume prompt}
This page took 0.029965 seconds and 4 git commands to generate.