X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=doc%2Ftar.texi;h=fa5bf007cd60f2567d3c26e958cf138e32bdbbe0;hb=18641602c18523705cf89f949a15dc02fe66e970;hp=621ce6063071ae0d83f6d16150e06010269a38b4;hpb=49ea4c50575f66e8f0450e463e1d882eed6255ec;p=chaz%2Ftar diff --git a/doc/tar.texi b/doc/tar.texi index 621ce60..fa5bf00 100644 --- a/doc/tar.texi +++ b/doc/tar.texi @@ -35,7 +35,7 @@ This manual is for @acronym{GNU} @command{tar} (version from archives. Copyright @copyright{} 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2001, -2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -2009,7 +2009,7 @@ attention to them. Each option has at least one @dfn{long} (or @dfn{mnemonic}) name starting with two dashes in a row, e.g., @option{--list}. The long names are more clear than their corresponding short or old names. It sometimes happens that a -single long option has many different different names which are +single long option has many different names which are synonymous, such as @option{--compare} and @option{--diff}. In addition, long option names can be given unique abbreviations. For example, @option{--cre} can be used in place of @option{--create} because there is no @@ -2502,8 +2502,42 @@ patterns in the file @var{file}. @xref{exclude}. @opsummary{exclude-caches} @item --exclude-caches -Automatically excludes all directories -containing a cache directory tag. @xref{exclude}. +Exclude from dump any directory containing a valid cache directory +tag file, but still dump the directory node and the tag file itself. + +@xref{exclude}. + +@opsummary{exclude-caches-under} +@item --exclude-caches-under + +Exclude from dump any directory containing a valid cache directory +tag file, but still dump the directory node itself. + +@xref{exclude}. + +@opsummary{exclude-caches-all} +@item --exclude-caches-all + +Exclude from dump any directory containing a valid cache directory +tag file. @xref{exclude}. + +@opsummary{exclude-tag} +@item --exclude-tag=@var{file} + +Exclude from dump any directory containing file named @var{file}, but +dump the directory node and @var{file} itself. @xref{exclude}. + +@opsummary{exclude-tag-under} +@item --exclude-tag-under=@var{file} + +Exclude from dump the contents of any directory containing file +named @var{file}, but dump the directory node itself. @xref{exclude}. + +@opsummary{exclude-tag-all} +@item --exclude-tag-all=@var{file} + +Exclude from dump any directory containing file named @var{file}. +@xref{exclude}. @opsummary{file} @item --file=@var{archive} @@ -6465,15 +6499,9 @@ called as @w{@samp{tar -c -X foo .}} and the file @file{foo} contains a single line @file{*.o}, no files whose names end in @file{.o} will be added to the archive. -@table @option -@opindex exclude-caches -@item --exclude-caches -Causes @command{tar} to ignore directories containing a cache directory tag. -@end table - @findex exclude-caches -When creating an archive, the @option{--exclude-caches} option causes -@command{tar} to exclude all directories that contain a @dfn{cache +When creating an archive, the @option{--exclude-caches} option family +causes @command{tar} to exclude all directories that contain a @dfn{cache directory tag}. A cache directory tag is a short file with the well-known name @file{CACHEDIR.TAG} and having a standard header specified in @url{http://www.brynosaurus.com/cachedir/spec.html}. @@ -6481,6 +6509,107 @@ Various applications write cache directory tags into directories they use to hold regenerable, non-precious data, so that such data can be more easily excluded from backups. +There are three @samp{exclude-caches} option, providing a different +exclusion semantics: + +@table @option +@opindex exclude-caches +@item --exclude-caches +Do not archive the contents of the directory, but archive the +directory itself and the @file{CACHEDIR.TAG} file. + +@opindex exclude-caches-under +@item --exclude-caches-under +Do not archive the contents of the directory, nor the +@file{CACHEDIR.TAG} file, archive only the directory itself. + +@opindex exclude-caches-all +@item --exclude-caches-all +Omit directories containing @file{CACHEDIR.TAG} file entirely. +@end table + +@findex exclude-tag +Another option family, @option{--exclude-tag}, provides a generalization of +this concept. It takes a single argument, a file name to look for. +Any directory that contains this file will be excluded from the dump. +Similarly to @samp{exclude-caches}, there are three options in this +option family: + +@table @option +@opindex exclude-tag +@item --exclude-tag=@var{file} +Do not dump the contents of the directory, but dump the +directory itself and the @var{file}. + +@opindex exclude-tag-under +@item --exclude-tag-under=@var{file} +Do not dump the contents of the directory, nor the +@var{file}, archive only the directory itself. + +@opindex exclude-tag-all +@item --exclude-tag-all=@var{file} +Omit directories containing @var{file} file entirely. +@end table + +Multiple @option{--exclude-tag*} options can be given. + +For example, given this directory: + +@smallexample +@group +$ @kbd{find dir} +dir +dir/blues +dir/jazz +dir/folk +dir/folk/tagfile +dir/folk/sanjuan +dir/folk/trote +@end group +@end smallexample + +The @option{--exclude-tag} will produce the following: + +@smallexample +$ @kbd{tar -cf archive.tar --exclude-tag=tagfile -v dir} +dir/ +dir/blues +dir/jazz +dir/folk/ +tar: dir/folk/: contains a cache directory tag tagfile; + contents not dumped +dir/folk/tagfile +@end smallexample + +Both the @file{dir/folk} directory and its tagfile are preserved in +the archive, however the rest of files in this directory are not. + +Now, using the @option{--exclude-tag-under} option will exclude +@file{tagfile} from the dump, while still preserving the directory +itself, as shown in this example: + +@smallexample +$ @kbd{tar -cf archive.tar --exclude-tag-under=tagfile -v dir} +dir/ +dir/blues +dir/jazz +dir/folk/ +./tar: dir/folk/: contains a cache directory tag tagfile; + contents not dumped +@end smallexample + +Finally, using @option{--exclude-tag-all} omits the @file{dir/folk} +directory entirely: + +@smallexample +$ @kbd{tar -cf archive.tar --exclude-tag-all=tagfile -v dir} +dir/ +dir/blues +dir/jazz +./tar: dir/folk/: contains a cache directory tag tagfile; + directory not dumped +@end smallexample + @menu * problems with exclude:: @end menu @@ -10086,10 +10215,15 @@ Short option describing the operation @command{tar} is executing @item TAR_FORMAT Format of the archive being processed. @xref{Formats}, for a complete list of archive format names. + +@vrindex TAR_FD, info script environment variable +@item TAR_FD +File descriptor which can be used to communicate the new volume +name to @command{tar}. @end table The volume script can instruct @command{tar} to use new archive name, -by writing in to file descriptor 3 (see below for an example). +by writing in to file descriptor @env{$TAR_FD} (see below for an example). If the info script fails, @command{tar} exits; otherwise, it begins writing the next volume. @@ -10114,7 +10248,7 @@ The second method is to use the @samp{n} response to the tape-change prompt. Finally, the most flexible approach is to use a volume script, that -writes new archive name to the file descriptor #3. For example, the +writes new archive name to the file descriptor @env{$TAR_FD}. For example, the following volume script will create a series of archive files, named @file{@var{archive}-@var{vol}}, where @var{archive} is the name of the archive being created (as given by @option{--file} option) and @@ -10133,7 +10267,7 @@ case $TAR_SUBCOMMAND in *) exit 1 esac -echo $@{name:-$TAR_ARCHIVE@}-$TAR_VOLUME >&3 +echo $@{name:-$TAR_ARCHIVE@}-$TAR_VOLUME >&$TAR_FD @end group @end smallexample