X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=doc%2Ftar.texi;h=979e2427954ef2d199774456a8325cf7608b9c4a;hb=f0a1f78196f75678424712ac36f0a4a46e3e5658;hp=ddfa055e47e570a1c00956e3d9b3f71a62274351;hpb=751b61ab25ddc03510a695d55a916943aea2f6f0;p=chaz%2Ftar diff --git a/doc/tar.texi b/doc/tar.texi index ddfa055..979e242 100644 --- a/doc/tar.texi +++ b/doc/tar.texi @@ -2804,6 +2804,21 @@ Specifies that @command{tar} should ask the user for confirmation before performing potentially destructive options, such as overwriting files. @xref{interactive}. +@opsummary{--keep-directory-symlink} +@item --keep-directory-symlink + +This option changes the behavior of tar when it encounters a symlink +with the same name as the directory that it is about to extract. By +default, in this case tar would first remove the symlink and then +proceed extracting the directory. + +The @option{--keep-directory-symlink} option disables this behavior +and instructs tar to follow symlinks to directories when extracting +from the archive. + +It is mainly intended to provide compatibility with the Slackware +installation scripts. + @opsummary{keep-newer-files} @item --keep-newer-files @@ -3946,10 +3961,10 @@ e.g.: @end smallexample The @samp{%s} and @samp{%u} in the above example are -@dfn{meta-characters}. The @samp{%s} meta-character is replaced with +@dfn{format specifiers}. The @samp{%s} specifier is replaced with the @dfn{type} of the checkpoint: @samp{write} or @samp{read} (or a corresponding translated version in locales other -than @acronym{POSIX}). The @samp{%u} meta-character is replaced with +than @acronym{POSIX}). The @samp{%u} specifier is replaced with the ordinal number of the checkpoint. Thus, the above example could produce the following output when used with the @option{--create} option: @@ -3960,7 +3975,46 @@ tar: Hit write checkpoint #20 tar: Hit write checkpoint #30 @end smallexample -Aside from meta-character expansion, the message string is subject to +The complete list of available format specifiers follows: + +@table @samp +@item %s +Print type of the checkpoint (@samp{write} or @samp{read}). + +@item %u +Print number of the checkpoint. + +@item %T +Print number of bytes transferred so far and approximate transfer +speed. The number is preceded by @samp{W:}, when writing and by +@samp{R:} when reading. If @command{tar} is performing delete +operation (@pxref{delete}), three numbers are printed: number of bytes +read, written and deleted, each of them prefixed by @samp{R:}, +@samp{W:} and @samp{D:} correspondingy. For example: + +@example +$ @kbd{tar --delete -f f.tar --checkpoint-action=echo="#%u: %T" main.c} +tar: #1: R: 0 (0B, ?/s),W: 0 (0B, ?/s),D: 0 +tar: #2: R: 10240 (10KiB, 19MiB/s),W: 0 (0B, 0B/s),D: 10240 +@end example + +@noindent +See also the @samp{totals} action, described below. + +@item %@{@var{fmt}@}t +Output current local time using @var{fmt} as format for @command{strftime} +(@pxref{strftime, strftime,,strftime(3), strftime(3) man page}). The +@samp{@{@var{fmt}@}} part is optional. If not present, the default +format is @samp{%c}, i.e. the preferred date and time representation +for the current locale. + +@item %@{@var{n}@}* +Pad output with spaces to the @var{n}th column. If the +@samp{@{@var{n}@}} part is omitted, the current screen width +is assumed. +@end table + +Aside from format expansion, the message string is subject to @dfn{unquoting}, during which the backslash @dfn{escape sequences} are replaced with their corresponding @acronym{ASCII} characters (@pxref{escape sequences}). E.g. the following action will produce an @@ -3987,9 +4041,23 @@ following action will print the checkpoint message at the same screen line, overwriting any previous message: @smallexample ---checkpoint-action="ttyout=\rHit %s checkpoint #%u" +--checkpoint-action="ttyout=Hit %s checkpoint #%u%*\r" @end smallexample +@noindent +Notice the use of @samp{%*} specifier to clear out any eventual +remains of the prior output line. As as more complex example, +consider this: + +@smallexample +--checkpoint-action=ttyout='%@{%Y-%m-%d %H:%M:%S@}t (%d sec): #%u, %T%*\r' +@end smallexample + +@noindent +This prints the current local time, number of seconds expired since +tar was started, the checkpoint ordinal number, transferred bytes and +average computed I/O speed. + @cindex @code{dot}, checkpoint action Another available checkpoint action is @samp{dot} (or @samp{.}). It instructs @command{tar} to print a single dot on the standard listing @@ -4004,6 +4072,12 @@ For compatibility with previous @GNUTAR{} versions, this action can be abbreviated by placing a dot in front of the checkpoint frequency, as shown in the previous section. +@cindex @code{totals}, checkpoint action +The @samp{totals} action prints the total number of bytes transferred +so far. The format of the data is the same as for the +@option{--totals} option (@pxref{totals}). See also @samp{%T} format +specifier of the @samp{echo} or @samp{ttyout} action. + @cindex @code{sleep}, checkpoint action Yet another action, @samp{sleep}, pauses @command{tar} for a specified amount of seconds. The following example will stop for 30 seconds at each @@ -4221,6 +4295,10 @@ tar (child): trying gzip This means that @command{tar} first tried to decompress @file{archive.Z} using @command{compress}, and, when that failed, switched to @command{gzip}. +@kwindex record-size +@cindex @samp{Record size = %lu blocks}, warning message +@item record-size +@samp{Record size = %lu blocks} @end table @subheading Keywords controlling incremental extraction: @@ -10706,15 +10784,16 @@ When reading an archive, @command{tar} can usually figure out the record size on itself. When this is the case, and a non-standard record size was used when the archive was created, @command{tar} will print a message about a non-standard blocking factor, and then operate -normally. On some tape devices, however, @command{tar} cannot figure -out the record size itself. On most of those, you can specify a -blocking factor (with @option{--blocking-factor}) larger than the -actual blocking factor, and then use the @option{--read-full-records} -(@option{-B}) option. (If you specify a blocking factor with -@option{--blocking-factor} and don't use the -@option{--read-full-records} option, then @command{tar} will not -attempt to figure out the recording size itself.) On some devices, -you must always specify the record size exactly with +normally@footnote{If this message is not needed, you can turn it off +using the @option{--warning=no-record-size} option.}. On some tape +devices, however, @command{tar} cannot figure out the record size +itself. On most of those, you can specify a blocking factor (with +@option{--blocking-factor}) larger than the actual blocking factor, +and then use the @option{--read-full-records} (@option{-B}) option. +(If you specify a blocking factor with @option{--blocking-factor} and +don't use the @option{--read-full-records} option, then @command{tar} +will not attempt to figure out the recording size itself.) On some +devices, you must always specify the record size exactly with @option{--blocking-factor} when reading, because @command{tar} cannot figure it out. In any case, use @option{--list} (@option{-t}) before doing any extractions to see whether @command{tar} is reading the archive