[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9 Controlling Warning Messages

Sometimes, while performing the requested task, GNU tar notices some conditions that are not exactly errors, but which the user should be aware of. When this happens, tar issues a warning message describing the condition. Warning messages are output to the standard error and they do not affect the exit code of tar command.

GNU tar allows the user to suppress some or all of its warning messages:

--warning=keyword

Control display of the warning messages identified by keyword. If keyword starts with the prefix ‘no-’, such messages are suppressed. Otherwise, they are enabled.

Multiple ‘--warning’ options accumulate.

By default, GNU tar enables all messages, except those that are enabled in verbose mode (see section The ‘--verbose’ Option). See section Default Warning Settings, for details.

The subsections below discuss allowed values for keyword along with the warning messages they control.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.1 Keywords controlling tar operation

These keywords control warnings that may appear in any GNU tar operation mode:

warning: filename-with-nuls

file name read contains nul character

warning: filename-with-nuls

%s: file name read contains nul character

warning: alone-zero-block

A lone zero block at %s’. Notice, that this warning is suppressed if ‘--ignore-zeros’ is in effect (see section Ignoring Blocks of Zeros).

warning: missing-zero-blocks

Terminating zero blocks missing at %s’. This warning is suppressed if ‘--ignore-zeros’ is in effect (see section Ignoring Blocks of Zeros).


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.2 Keywords applicable for tar --create

The following keywords control messages that can be issued while creating archives.

warning: cachedir

%s: contains a cache directory tag %s; %s

warning: file-shrank

%s: File shrank by %s bytes; padding with zeros

warning: xdev

%s: file is on a different filesystem; not dumped

warning: file-ignored

%s: Unknown file type; file ignored
%s: socket ignored
%s: door ignored

warning: file-unchanged

%s: file is unchanged; not dumped

warning: ignore-archive

%s: archive cannot contain itself; not dumped

warning: file-removed

%s: File removed before we read it

warning: file-changed

%s: file changed as we read it

Suppresses warnings about read failures, which can occur if files or directories are unreadable, or if they change while being read. This keyword applies only if used together with the ‘--ignore-failed-read’ option. See section Ignore Failed Read.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.3 Keywords applicable for tar --extract

The following keywords control warnings that can be issued during archive extraction.

warning: existing-file

%s: skipping existing file

warning: timestamp

%s: implausibly old time stamp %s
%s: time stamp %s is %s s in the future

warning: contiguous-cast

Extracting contiguous files as regular files

warning: symlink-cast

Attempting extraction of symbolic links as hard links’, warning message ‘Attempting extraction of symbolic links as hard links

warning: unknown-cast

%s: Unknown file type '%c', extracted as normal file

warning: ignore-newer

Current %s is newer or same age

warning: unknown-keyword

Ignoring unknown extended header keyword '%s'

warning: decompress-program

Controls verbose description of failures occurring when trying to run alternative decompressor programs (see alternative decompression programs). This warning is disabled by default (unless ‘--verbose’ is used). A common example of what you can get when using this warning is:

$ tar --warning=decompress-program -x -f archive.Z
tar (child): cannot run compress: No such file or directory
tar (child): trying gzip

This means that tar first tried to decompress ‘archive.Z’ using compress, and, when that failed, switched to gzip.

warning: record-size

Record size = %lu blocks


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.4 Keywords controlling incremental extraction

These keywords control warnings that may appear when extracting from incremental archives.

warning: rename-directory

%s: Directory has been renamed from %s
%s: Directory has been renamed

warning: new-directory

%s: Directory is new

warning: xdev

%s: directory is on a different device: not purging

warning: bad-dumpdir

Malformed dumpdir: 'X' never used


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.5 Warning Classes

These convenience keywords define warning classes. When used, they affect several warnings at once.

warning: all

Enable all warning messages.

warning: none

Disable all warning messages.

warning: verbose

A shorthand for all messages enabled when ‘--verbose’ (see section The ‘--verbose’ Option) is in effect. These are: decompress-program, existing-file, new-directory, record-size, rename-directory.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.9.6 Default Warning Settings

GNU tar default settings correspond to:

--warning=all --warning=no-verbose --warning=no-missing-zero-blocks

[ << ] [ < ] [ Up ] [ > ] [ >> ]

This document was generated on August 23, 2023 using texi2html 5.0.