* concatenate::
* delete::
* compare::
+* quoting styles::
How to Add Files to Existing Archives: @option{--append}
direct its output to available devices, files, or other programs (using
pipes). @command{tar} may even access remote devices or files (as archives).
-@FIXME{the following table entries need a bit of work..}
-
You can use @command{tar} archives in many ways. We want to stress a few
of them: storage, backup, and transportation.
+@FIXME{the following table entries need a bit of work..}
@table @asis
@item Storage
Often, @command{tar} archives are used to store related files for
it. (It makes no sense to put an archive into itself.) @GNUTAR{}
will continue in this case, and create the archive
normally, except for the exclusion of that one file. (@emph{Please
-note:} Other versions of @command{tar} are not so clever; they will
-enter an infinite loop when this happens, so you should not depend on
-this behavior unless you are certain you are running @GNUTAR{}.)
- @FIXME{bob doesn't like this sentence, since he does
-it all the time, and we've been doing it in the editing passes for
-this manual: In general, make sure that the archive is not inside a
-directory being dumped.}
+note:} Other implementations of @command{tar} may not be so clever;
+they will enter an infinite loop when this happens, so you should not
+depend on this behavior unless you are certain you are running
+@GNUTAR{}. In general, it is wise to always place the archive outside
+of the directory being dumped.
@node list
@section How to List Archives
jazz
@end smallexample
-@FIXME{we hope this will change. if it doesn't, need to show the
-creation of bfiles somewhere above!!! : }
-
@noindent
The archive @file{bfiles.tar} would list as follows:
@end smallexample
@noindent
-Be sure to use a @option{--file=@var{archive-name}} (@option{-f @var{archive-name}}) option just as with @option{--create} (@option{-c})
-to specify the name of the archive.
+Be sure to use a @option{--file=@var{archive-name}} (@option{-f
+@var{archive-name}}) option just as with @option{--create}
+(@option{-c}) to specify the name of the archive.
@opindex list, using with @option{--verbose}
@opindex verbose, using with @option{--list}
-If you use the @option{--verbose} (@option{-v}) option with @option{--list}, then
-@command{tar} will print out a listing reminiscent of @w{@samp{ls -l}},
-showing owner, file size, and so forth.
+If you use the @option{--verbose} (@option{-v}) option with
+@option{--list}, then @command{tar} will print out a listing
+reminiscent of @w{@samp{ls -l}}, showing owner, file size, and so forth.
-If you had used @option{--verbose} (@option{-v}) mode, the example above would look
-like:
+If you had used @option{--verbose} (@option{-v}) mode, the example
+above would look like:
@smallexample
$ @kbd{tar --list --verbose --file=collection.tar folk}
@noindent
If you list the files in the directory again, you will see that the file
@file{blues} has been restored, with its original permissions, data
-modification times, and owner.@FIXME{This is only accidentally true, but not in
-general. In most cases, one has to be root for restoring the owner, and
-use a special option for restoring permissions. Here, it just happens
-that the restoring user is also the owner of the archived members, and
-that the current @code{umask} is compatible with original permissions.}
-(These parameters will be identical to those which
+modification times, and owner.@footnote{This is only accidentally
+true, but not in general. Whereas modification times are always
+restored, in most cases, one has to be root for restoring the owner,
+and use a special option for restoring permissions. Here, it just
+happens that the restoring user is also the owner of the archived
+members, and that the current @code{umask} is compatible with original
+permissions.} (These parameters will be identical to those which
the file had when you originally placed it in the archive; any changes
you may have made before deleting the file from the file system,
however, will @emph{not} have been made to the archive member.) The
directory as @file{practice}, you must give @file{practice} as part
of the file names when you extract those files from the archive.
-@FIXME{IMPORTANT! show the final structure, here. figure out what it
-will be.}
-
@node extracting untrusted archives
@subsection Extracting Archives from Untrusted Sources
mnemonic option @option{--list}. So for example, the command @w{@samp{tar
cv}} specifies the option @option{-v} in addition to the operation @option{-c}.
-@FIXME{bob suggests having an uglier example. :-) }
-
When options that need arguments are given together with the command,
all the associated arguments follow, in the same order as the options.
Thus, the example given previously could also be written in the old
@kbd{tar cf archive.tar.gz -z file}
@end smallexample
-@FIXME{still could explain this better; it's redundant:}
-
@cindex option syntax, traditional
As far as we know, all @command{tar} programs, @acronym{GNU} and
non-@acronym{GNU}, support old options. @GNUTAR{}
@item --update
@itemx -u
-@FIXME{It was: A combination of the @option{--compare} and
-@option{--append} operations. This is not true and rather misleading,
-as @option{--compare} does a lot more than @option{--update} for
-ensuring files are identical.} Adds files to the end of the archive,
-but only if they are newer than their counterparts already in the
-archive, or if they do not already exist in the archive.
-@xref{update}.
+Adds files to the end of the archive, but only if they are newer than
+their counterparts already in the archive, or if they do not already
+exist in the archive. @xref{update}.
@end table
@opindex no-quote-chars, summary
@item --no-quote-chars=@var{string}
-Do not quote characters from @var{string}, even if the selected
-quoting style implies they should be quoted (@FIXME-pxref{Quoting Styles}).
+Remove characters listed in @var{string} from the list of quoted
+characters set by the previous @option{--quote-chars} option
+(@pxref{quoting styles}).
@opindex no-recursion, summary
@item --no-recursion
This option does not affect extraction from archives.
+@opindex transform, summary
+@item --transform=@var{sed-expr}
+
+Transform file or member names using @command{sed} replacement expression
+@var{sed-expr}. For example,
+
+@smallexample
+$ @kbd{tar cf archive.tar --transform 's,^\./,usr/,' .}
+@end smallexample
+
+@noindent
+will add to @file{archive} files from the current working directory,
+replacing initial @samp{./} prefix with @samp{usr/}. For the detailed
+discussion, see @FIXME-xref{transform}
+
+To see transformed member names in verbose listings, use
+@option{--show-transformed-names} option
+(@FIXME-pxref{show-transformed-names}).
+
@opindex quote-chars, summary
@item --quote-chars=@var{string}
Always quote characters from @var{string}, even if the selected
-quoting style would not quote them (@FIXME-pxref{Quoting Styles}).
+quoting style would not quote them (@pxref{quoting styles}).
@opindex quoting-style, summary
@item --quoting-style=@var{style}
Set quoting style to use when printing member and file names
-(@FIXME-pxref{Quoting Styles}). Valid @var{style} values are:
+(@pxref{quoting styles}). Valid @var{style} values are:
@code{literal}, @code{shell}, @code{shell-always}, @code{c},
@code{escape}, @code{locale}, and @code{clocale}. Default quoting
style is @code{escape}, unless overridden while configuring the
Instructs @command{tar} to mention directories its skipping over when
operating on a @command{tar} archive. @xref{show-omitted-dirs}.
+@opindex show-transformed-names, summary
@opindex show-stored-names, summary
-@item --show-stored-names
+@item --show-transformed-names
+@itemx --show-stored-names
-This option has effect only when used in conjunction with one of
-archive creation operations. It instructs tar to list the member names
+Display file or member names after applying any transformations
+(@FIXME-pxref{}). In particular, when used in conjunction with one of
+archive creation operations it instructs tar to list the member names
stored in the archive, as opposed to the actual file
names. @xref{listing member and file names}.
as @command{tar} reads or writes the archive. In fact, it prints
a message each 10 records read or written. It is designed for
those who don't need the more detailed (and voluminous) output of
-@option{--block-number} (@option{-R}), but do want visual confirmation that @command{tar}
-is actually making forward progress.
+@option{--block-number} (@option{-R}), but do want visual confirmation
+that @command{tar} is actually making forward progress.
@FIXME{There is some confusion here. It seems that -R once wrote a
message at @samp{every} record read or written.}
* concatenate::
* delete::
* compare::
+* quoting styles::
@end menu
@node Operations
@cindex Archives, Appending files to
The simplest way to add a file to an already existing archive is the
-@option{--append} (@option{-r}) operation, which writes specified files into the
-archive whether or not they are already among the archived files.
+@option{--append} (@option{-r}) operation, which writes specified
+files into the archive whether or not they are already among the
+archived files.
+
When you use @option{--append}, you @emph{must} specify file name
arguments, as there is no default. If you specify a file that already
exists in the archive, another copy of the file will be added to the
-rw-r--r-- me user 20 1996-09-23 16:44 rock
@end smallexample
-@FIXME{in theory, dan will (soon) try to turn this node into what it's
-title claims it will become...}
-
@node multiple
@subsubsection Multiple Files with the Same Name
-You can use @option{--append} (@option{-r}) to add copies of files which have been
-updated since the archive was created. (However, we do not recommend
-doing this since there is another @command{tar} option called
-@option{--update}; @pxref{update} for more information. We describe this
-use of @option{--append} here for the sake of completeness.) @FIXME{is
-this really a good idea, to give this whole description for something
-which i believe is basically a Stupid way of doing something? certain
-aspects of it show ways in which tar is more broken than i'd personally
-like to admit to, specifically the last sentence. On the other hand, i
-don't think it's a good idea to be saying that we explicitly don't
-recommend using something, but i can't see any better way to deal with
-the situation.}When you extract the archive, the older version will be
-effectively lost. This works because files are extracted from an
+You can use @option{--append} (@option{-r}) to add copies of files
+which have been updated since the archive was created. (However, we
+do not recommend doing this since there is another @command{tar}
+option called @option{--update}; @xref{update}, for more information.
+We describe this use of @option{--append} here for the sake of
+completeness.) When you extract the archive, the older version will
+be effectively lost. This works because files are extracted from an
archive in the order in which they were archived. Thus, when the
archive is extracted, a file archived later in time will replace a
-file of the same name which was archived earlier, even though the older
-version of the file will remain in the archive unless you delete all
-versions of the file.
+file of the same name which was archived earlier, even though the
+older version of the file will remain in the archive unless you delete
+all versions of the file.
Supposing you change the file @file{blues} and then append the changed
version to @file{collection.tar}. As you saw above, the original
@node how to update
@subsubsection How to Update an Archive Using @option{--update}
-You must use file name arguments with the @option{--update} (@option{-u}) operation.
-If you don't specify any files, @command{tar} won't act on any files and
-won't tell you that it didn't do anything (which may end up confusing
-you).
+You must use file name arguments with the @option{--update}
+(@option{-u}) operation. If you don't specify any files,
+@command{tar} won't act on any files and won't tell you that it didn't
+do anything (which may end up confusing you).
-@FIXME{note: the above parenthetical added because in fact, this
-behavior just confused the author. :-) }
+@c note: the above parenthetical added because in fact, this
+@c behavior just confused the author. :-)
To see the @option{--update} option at work, create a new file,
@file{classical}, in your practice directory, and some extra text to the
file @file{blues}, using any text editor. Then invoke @command{tar} with
-the @samp{update} operation and the @option{--verbose} (@option{-v}) option specified,
-using the names of all the files in the practice directory as file name
-arguments:
+the @samp{update} operation and the @option{--verbose} (@option{-v})
+option specified, using the names of all the files in the practice
+directory as file name arguments:
@smallexample
$ @kbd{tar --update -v -f collection.tar blues folk rock classical}
folk
jazz
rock
-practice/blues
-practice/folk
-practice/jazz
-practice/rock
-practice/blues
$ @kbd{tar --delete --file=collection.tar blues}
$ @kbd{tar --list --file=collection.tar}
folk
$
@end smallexample
-@FIXME{I changed the order of these nodes around and haven't had a chance
-to fix the above example's results, yet. I have to play with this and
-follow it and see what it actually does!}
+@FIXME{Check if the above listing is actually produced after running
+all the examples on collection.tar.}
The @option{--delete} option has been reported to work properly when
@command{tar} acts as a filter from @code{stdin} to @code{stdout}.
tar: funk not found in archive
@end smallexample
-The spirit behind the @option{--compare} (@option{--diff}, @option{-d}) option is to check whether the
-archive represents the current state of files on disk, more than validating
-the integrity of the archive media. For this later goal, @xref{verify}.
+The spirit behind the @option{--compare} (@option{--diff},
+@option{-d}) option is to check whether the archive represents the
+current state of files on disk, more than validating the integrity of
+the archive media. For this later goal, @xref{verify}.
+
+@node quoting styles
+@subsection Quoting Member Names
+
+When displaying member names, @command{tar} takes care to avoid
+ambiguities caused by certain characters. This is called @dfn{name
+quoting}. The characters in question are:
+
+@itemize @bullet
+@item Non-printable control characters:
+
+@multitable @columnfractions 0.20 0.10 0.60
+@headitem Character @tab ASCII @tab Character name
+@item \a @tab 7 @tab Audible bell
+@item \b @tab 8 @tab Backspace
+@item \f @tab 12 @tab Form feed
+@item \n @tab 10 @tab New line
+@item \r @tab 13 @tab Carriage return
+@item \t @tab 9 @tab Horizontal tabulation
+@item \v @tab 11 @tab Vertical tabulation
+@end multitable
+
+@item Space (ASCII 32)
+
+@item Single and double quotes (@samp{'} and @samp{"})
+
+@item Backslash (@samp{\})
+@end itemize
+
+The exact way @command{tar} uses to quote these characters depends on
+the @dfn{quoting style}. The default quoting style, called
+@dfn{escape} (see below), uses backslash notation to represent control
+characters, space and backslash. Using this quoting style, control
+characters are represented as listed in column @samp{Character} in the
+above table, a space is printed as @samp{\ } and a backslash as @samp{\\}.
+
+@GNUTAR{} offers seven distinct quoting styles, which can be selected
+using @option{--quoting-style} option:
+
+@table @option
+@item --quoting-style=@var{style}
+@opindex quoting-style
+
+Sets quoting style. Valid values for @var{style} argument are:
+literal, shell, shell-always, c, escape, locale, clocale.
+@end table
+
+These styles are described in detail below. To illustrate their
+effect, we will use an imaginary tar archive @file{arch.tar}
+containing the following members:
+
+@smallexample
+@group
+# 1. Contains horizontal tabulation character.
+a tab
+# 2. Contains newline character
+a
+newline
+# 3. Contains a space
+a space
+# 4. Contains double quotes
+a"double"quote
+# 5. Contains single quotes
+a'single'quote
+# 6. Contains a backslash character:
+a\backslash
+@end group
+@end smallexample
+
+Here is how usual @command{ls} command would have listed them, if they
+had existed in the current working directory:
+
+@smallexample
+@group
+$ @kbd{ls}
+a\ttab
+a\nnewline
+a\ space
+a"double"quote
+a'single'quote
+a\\backslash
+@end group
+@end smallexample
+
+Quoting styles:
+
+@table @samp
+@item literal
+No quoting, display each character as is:
+
+@smallexample
+@group
+$ @kbd{tar tf arch.tar --quoting-style=literal}
+./
+./a space
+./a'single'quote
+./a"double"quote
+./a\backslash
+./a tab
+./a
+newline
+@end group
+@end smallexample
+
+@item shell
+Display characters the same way Bourne shell does:
+control characters, except @samp{\t} and @samp{\n}, are printed using
+backslash escapes, @samp{\t} and @samp{\n} are printed as is, and a
+single quote is printed as @samp{\'}. If a name contains any quoted
+characters, it is enclosed in single quotes. In particular, if a name
+contains single quotes, it is printed as several single-quoted strings:
+
+@smallexample
+@group
+$ @kbd{tar tf arch.tar --quoting-style=shell}
+./
+'./a space'
+'./a'\''single'\''quote'
+'./a"double"quote'
+'./a\backslash'
+'./a tab'
+'./a
+newline'
+@end group
+@end smallexample
+
+@item shell-always
+Same as @samp{shell}, but the names are always enclosed in single
+quotes:
+
+@smallexample
+@group
+$ @kbd{tar tf arch.tar --quoting-style=shell-always}
+'./'
+'./a space'
+'./a'\''single'\''quote'
+'./a"double"quote'
+'./a\backslash'
+'./a tab'
+'./a
+newline'
+@end group
+@end smallexample
+
+@item c
+Use the notation of the C programming language. All names are
+enclosed in double quotes. Control characters are quoted using
+backslash notations, double quotes are represented as @samp{\"},
+backslash characters are represented as @samp{\\}. Single quotes and
+spaces are not quoted:
+
+@smallexample
+@group
+$ @kbd{tar tf arch.tar --quoting-style=c}
+"./"
+"./a space"
+"./a'single'quote"
+"./a\"double\"quote"
+"./a\\backslash"
+"./a\ttab"
+"./a\nnewline"
+@end group
+@end smallexample
+
+@item escape
+Control characters are printed using backslash notation, a space is
+printed as @samp{\ } and a backslash as @samp{\\}. This is the
+default quoting style, unless it was changed when configured the
+package.
+
+@smallexample
+@group
+$ @kbd{tar tf arch.tar --quoting-style=escape}
+./
+./a space
+./a'single'quote
+./a"double"quote
+./a\\backslash
+./a\ttab
+./a\nnewline
+@end group
+@end smallexample
+
+@item locale
+Control characters, single quote and backslash are printed using
+backslash notation. All names are quoted using left and right
+quotation marks, appropriate to the current locale. If it does not
+define quotation marks, use @samp{`} as left and @samp{'} as right
+quotation marks. Any occurrences of the right quotation mark in a
+name are escaped with @samp{\}, for example:
+
+For example:
+
+@smallexample
+@group
+$ @kbd{tar tf arch.tar --quoting-style=locale}
+`./'
+`./a space'
+`./a\'single\'quote'
+`./a"double"quote'
+`./a\\backslash'
+`./a\ttab'
+`./a\nnewline'
+@end group
+@end smallexample
+
+@item clocale
+Same as @samp{locale}, but @samp{"} is used for both left and right
+quotation marks, if not provided by the currently selected locale:
+
+@smallexample
+@group
+$ @kbd{tar tf arch.tar --quoting-style=clocale}
+"./"
+"./a space"
+"./a'single'quote"
+"./a\"double\"quote"
+"./a\\backslash"
+"./a\ttab"
+"./a\nnewline"
+@end group
+@end smallexample
+@end table
+
+You can specify which characters should be quoted in addition to those
+implied by the current quoting style:
+
+@table @option
+@item --quote-chars=@var{string}
+Always quote characters from @var{string}, even if the selected
+quoting style would not quote them.
+@end table
+
+For example, using @samp{escape} quoting (compare with the usual
+escape listing above):
+
+@smallexample
+@group
+$ @kbd{tar tf arch.tar --quoting-style=escape --quote-chars=' "'}
+./
+./a\ space
+./a'single'quote
+./a\"double\"quote
+./a\\backslash
+./a\ttab
+./a\nnewline
+@end group
+@end smallexample
+
+To disable quoting of such additional characters, use the following
+option:
+
+@table @option
+@item --no-quote-chars=@var{string}
+Remove characters listed in @var{string} from the list of quoted
+characters set by the previous @option{--quote-chars} option.
+@end table
+
+This option is particularly useful if you have added
+@option{--quote-chars} to your @env{TAR_OPTIONS} (@pxref{TAR_OPTIONS})
+and wish to disable it for the current invocation.
+
+Note, that @option{--no-quote-chars} does @emph{not} disable those
+characters that are quoted by default in the selected quoting style.
@node create options
@section Options Used by @option{--create}
@section Options Used by @option{--extract}
@UNREVISED
-@FIXME{i need to get dan to go over these options with me and see if
-there's a better way of organizing them.}
-
@opindex extract, additional options
The previous chapter showed how to use @option{--extract} to extract
an archive into the file system. Various options cause @command{tar} to
To set the modes (access permissions) of extracted files to those
recorded for those files in the archive, use @option{--same-permissions}
in conjunction with the @option{--extract} (@option{--get},
-@option{-x}) operation. @FIXME{Should be aliased to ignore-umask.}
+@option{-x}) operation.
@table @option
@opindex preserve-permission
@node remove files
@unnumberedsubsubsec Removing Files
-@FIXME{the various macros in the front of the manual think that this
-option goes in this section. i have no idea; i only know it's nowhere
-else in the book...}
+@FIXME{The section is too terse. Something more to add? An example,
+maybe?}
@table @option
@opindex remove-files
@section Choosing and Naming Archive Files
@UNREVISED
-@FIXME{should the title of this section actually be, "naming an
-archive"?}
-
@cindex Naming an archive
@cindex Archive Name
@cindex Choosing an archive file
By default, @command{tar} takes file names from the command line. However,
there are other ways to specify file or member names, or to modify the
manner in which @command{tar} selects the files or members upon which to
-operate. @FIXME{add xref here}In general, these methods work both for
-specifying the names of files and archive members.
+operate. In general, these methods work both for specifying the names
+of files and archive members.
@node files
@section Reading Names from a File
Date specifiers can have embedded spaces. Because of this, you may need
to quote date arguments to keep the shell from parsing them as separate
-arguments.
+arguments. For example, the following command will add to the archive
+all the files modified less than two days ago:
-@FIXME{Need example of --newer-mtime with quoted argument.}
+@smallexample
+$ @kbd{tar -cf foo.tar --newer-mtime '2 days ago'}
+@end smallexample
@quotation
@strong{Please Note:} @option{--after-date} and @option{--newer-mtime}
-should not be used for incremental backups. Some files (such as those
-in renamed directories) are not selected properly by these options.
-@xref{Incremental Dumps}.
+should not be used for incremental backups. @xref{Incremental Dumps},
+for proper way of creating incremental backups.
@end quotation
-@noindent
-@FIXME{which tells -- need to fill this in!}
-
@node recurse
@section Descending into Directories
@UNREVISED
@FIXME{arrggh! this is still somewhat confusing to me. :-< }
-@FIXME{show dan bob's comments, from 2-10-97}
-
Usually, @command{tar} will recursively explore all directories (either
those given on the command line or through the @option{--files-from}
option) for the various files they contain. However, you may not always
use the @command{find} utility for hunting through levels of directories to
construct a list of file names which you could then pass to @command{tar}.
@command{find} allows you to be more selective when choosing which files to
-archive; see @ref{files} for more information on using @command{find} with
+archive; see @ref{files}, for more information on using @command{find} with
@command{tar}, or look.
@table @option
directory entries themselves, but does not descend on them
recursively. Many people use @command{find} for locating files they
want to back up, and since @command{tar} @emph{usually} recursively
-descends on directories, they have to use the @samp{@w{! -d}} option
-to @command{find} @FIXME{needs more explanation or a cite to another
-info file}as they usually do not want all the files in a directory.
-They then use the @option{--files-from} option to archive the files
-located via @command{find}.
+descends on directories, they have to use the @samp{@w{-not -type d}}
+test in their @command{find} invocation (@pxref{Type, Type, Type test,
+find, Finding Files}), as they usually do not want all the files in a
+directory. They then use the @option{--files-from} option to archive
+the files located via @command{find}.
The problem when restoring files archived in this manner is that the
directories themselves are not in the archive; so the
@option{-p}) option does not affect them---while users might really
like it to. Specifying @option{--no-recursion} is a way to tell
@command{tar} to grab only the directory entries given to it, adding
-no new files on its own.
+no new files on its own. To summarize, if you use @command{find} to
+create a list of files to be stored in an archive, use it as follows:
+
+@smallexample
+@group
+$ @kbd{find @var{dir} @var{tests} | \
+ tar -cf @var{archive} -T - --no-recursion}
+@end group
+@end smallexample
The @option{--no-recursion} option also applies when extracting: it
causes @command{tar} to extract only the matched directory entries, not
@table @option
@opindex one-file-system
@item --one-file-system
-@itemx -l
Prevents @command{tar} from crossing file system boundaries when
archiving. Use in conjunction with any write operation.
@end table
itself, @command{tar} will not archive anything beneath it; in other words,
@command{tar} will not cross mount points.
-It is reported that using this option, the mount point is is archived,
-but nothing under it.
-
This option is useful for making full or incremental archival backups of
a file system. If this option is used in conjunction with
-@option{--verbose} (@option{-v}), files that are excluded are mentioned by name on the
-standard error.
+@option{--verbose} (@option{-v}), files that are excluded are
+mentioned by name on the standard error.
@menu
* directory:: Changing Directory
When you specify @option{--absolute-names} (@option{-P}),
@command{tar} stores file names including all superior directory
-names, and preserves leading slashes. If you only invoked
+names, and preserves leading slashes. If you only invoked
@command{tar} from the root directory you would never need the
@option{--absolute-names} option, but using this option
may be more convenient than switching to root.
@smallexample
$ @kbd{(cd / && tar -c -f archive.tar home)}
+# @i{or}:
$ @kbd{tar -c -f archive.tar -C / home}
@end smallexample
and produce uncompressed data on the standard output.
@end table
-@FIXME{I have one question, or maybe it's a suggestion if there isn't a way
-to do it now. I would like to use @option{--gzip}, but I'd also like
-the output to be fed through a program like @acronym{GNU}
-@command{ecc} (actually, right now that's @samp{exactly} what I'd like
-to use :-)), basically adding ECC protection on top of compression.
-It seems as if this should be quite easy to do, but I can't work out
-exactly how to go about it. Of course, I can pipe the standard output
-of @command{tar} through @command{ecc}, but then I lose (though I
-haven't started using it yet, I confess) the ability to have
-@command{tar} use @command{rmt} for it's I/O (I think).
-
-I think the most straightforward thing would be to let me specify a
-general set of filters outboard of compression (preferably ordered,
-so the order can be automatically reversed on input operations, and
-with the options they require specifiable), but beggars shouldn't be
-choosers and anything you decide on would be fine with me.
-
-By the way, I like @command{ecc} but if (as the comments say) it can't
-deal with loss of block sync, I'm tempted to throw some time at adding
-that capability. Supposing I were to actually do such a thing and
-get it (apparently) working, do you accept contributed changes to
-utilities like that? (Leigh Clayton @file{loc@@soliton.com}, May 1995).
-
-Isn't that exactly the role of the @option{--use-compress-prog=@var{program}} option?
-I never tried it myself, but I suspect you may want to write a
-@var{prog} script or program able to filter stdin to stdout to
-way you want. It should recognize the @option{-d} option, for when
-extraction is needed rather than creation.
-
-It has been reported that if one writes compressed data (through the
-@option{--gzip} or @option{--compress} options) to a DLT and tries to use
-the DLT compression mode, the data will actually get bigger and one will
-end up with less space on the tape.}
+@cindex gpg, using with tar
+@cindex gnupg, using with tar
+@cindex Using encrypted archives
+The @option{--use-compress-program} option, in particular, lets you
+implement your own filters, not necessarily dealing with
+compression/decomression. For example, suppose you wish to implement
+PGP encryption on top of compression, using @command{gpg} (@pxref{Top,
+gpg, gpg ---- encryption and signing tool, gpg}). The following
+script does that:
+
+@smallexample
+@group
+#! /bin/sh
+case $1 in
+-d) gpg --decrypt - | gzip -d -c;;
+'') gzip -c | gpg -s ;;
+*) echo "Unknown option $1">&2; exit 1;;
+esac
+@end group
+@end smallexample
+
+Suppose you name it @file{gpgz} and save it somewhere in your
+@env{PATH}. Then the following command will create a commpressed
+archive signed with your private key:
+
+@smallexample
+$ @kbd{tar -cf foo.tar.gpgz --use-compress=gpgz .}
+@end smallexample
+
+@noindent
+Likewise, the following command will list its contents:
+
+@smallexample
+$ @kbd{tar -tf foo.tar.gpgz --use-compress=gpgz .}
+@end smallexample
+
+@ignore
+The above is based on the following discussion:
+
+ I have one question, or maybe it's a suggestion if there isn't a way
+ to do it now. I would like to use @option{--gzip}, but I'd also like
+ the output to be fed through a program like @acronym{GNU}
+ @command{ecc} (actually, right now that's @samp{exactly} what I'd like
+ to use :-)), basically adding ECC protection on top of compression.
+ It seems as if this should be quite easy to do, but I can't work out
+ exactly how to go about it. Of course, I can pipe the standard output
+ of @command{tar} through @command{ecc}, but then I lose (though I
+ haven't started using it yet, I confess) the ability to have
+ @command{tar} use @command{rmt} for it's I/O (I think).
+
+ I think the most straightforward thing would be to let me specify a
+ general set of filters outboard of compression (preferably ordered,
+ so the order can be automatically reversed on input operations, and
+ with the options they require specifiable), but beggars shouldn't be
+ choosers and anything you decide on would be fine with me.
+
+ By the way, I like @command{ecc} but if (as the comments say) it can't
+ deal with loss of block sync, I'm tempted to throw some time at adding
+ that capability. Supposing I were to actually do such a thing and
+ get it (apparently) working, do you accept contributed changes to
+ utilities like that? (Leigh Clayton @file{loc@@soliton.com}, May 1995).
+
+ Isn't that exactly the role of the
+ @option{--use-compress-prog=@var{program}} option?
+ I never tried it myself, but I suspect you may want to write a
+ @var{prog} script or program able to filter stdin to stdout to
+ way you want. It should recognize the @option{-d} option, for when
+ extraction is needed rather than creation.
+
+ It has been reported that if one writes compressed data (through the
+ @option{--gzip} or @option{--compress} options) to a DLT and tries to use
+ the DLT compression mode, the data will actually get bigger and one will
+ end up with less space on the tape.
+@end ignore
@node sparse
@subsection Archiving Sparse Files
system backups as a matter of course, you can be assured the archive
will never take more space on the media than the files take on disk
(otherwise, archiving a disk filled with sparse files might take
-hundreds of tapes). @FIXME-xref{incremental when node name is set.}
+hundreds of tapes). @xref{Incremental Dumps}.
@end quotation
@command{tar} ignores the @option{--sparse} option when reading an archive.
When writing an archive, @command{tar} writes the user id and user name
separately. If it can't find a user name (because the user id is not
in @file{/etc/passwd}), then it does not write one. When restoring,
-and doing a @code{chmod} like when you use @option{--same-permissions},
-@FIXME{same-owner?}it tries to look the name (if one was written)
-up in @file{/etc/passwd}. If it fails, then it uses the user id
-stored in the archive instead.
+it tries to look the name (if one was written) up in
+@file{/etc/passwd}. If it fails, then it uses the user id stored in
+the archive instead.
@opindex no-same-owner
@item --no-same-owner
The @option{--preserve} option has no equivalent short option name.
It is equivalent to @option{--same-permissions} plus @option{--same-order}.
-@FIXME{I do not see the purpose of such an option. (Neither I. FP.)}
+@FIXME{I do not see the purpose of such an option. (Neither I. FP.)
+Neither do I. --Sergey}
@end table