GNU Info

Info Node: (tar.info)verify

(tar.info)verify


Next: Write Protection Prev: label Up: Media
Enter node , (file) or (file)node

Verifying Data as It is Stored
==============================

`-W'
`--verify'
     Attempt to verify the archive after writing.

   This option causes `tar' to verify the archive after writing it.
Each volume is checked after it is written, and any discrepancies are
recorded on the standard error output.

   Verification requires that the archive be on a back-space-able
medium.  This means pipes, some cartridge tape drives, and some other
devices cannot be verified.

   You can insure the accuracy of an archive by comparing files in the
system with archive members.  `tar' can compare an archive to the file
system as the archive is being written, to verify a write operation, or
can compare a previously written archive, to insure that it is up to
date.

   To check for discrepancies in an archive immediately after it is
written, use the `--verify' (`-W') option in conjunction with the
`--create' (`-c') operation.  When this option is specified, `tar'
checks archive members against their counterparts in the file system,
and reports discrepancies on the standard error.

   To verify an archive, you must be able to read it from before the end
of the last written entry.  This option is useful for detecting data
errors on some tapes.  Archives written to pipes, some cartridge tape
drives, and some other devices cannot be verified.

   One can explicitly compare an already made archive with the file
system by using the `--compare' (`--diff', `-d') option, instead of
using the more automatic `--verify' (`-W') option.  Note: compare.

   Note that these two options have a slightly different intent.  The
`--compare' (`--diff', `-d') option how identical are the logical
contents of some archive with what is on your disks, while the
`--verify' (`-W') option is really for checking if the physical
contents agree and if the recording media itself is of dependable
quality.  So, for the `--verify' (`-W') operation, `tar' tries to
defeat all in-memory cache pertaining to the archive, while it lets the
speed optimization undisturbed for the `--compare' (`--diff', `-d')
option.  If you nevertheless use `--compare' (`--diff', `-d') for media
verification, you may have to defeat the in-memory cache yourself,
maybe by opening and reclosing the door latch of your recording unit,
forcing some doubt in your operating system about the fact this is
really the same volume as the one just written or read.

   The `--verify' (`-W') option would not be necessary if drivers were
indeed able to detect dependably all write failures.  This sometimes
require many magnetic heads, some able to read after the writes
occurred.  One would not say that drivers unable to detect all cases
are necessarily flawed, as long as programming is concerned.

   The `--verify' (`-W') option will not work in conjunction with the
`--multi-volume' (`-M') option or the `--append' (`-r'), `--update'
(`-u') and `--delete' operations.  Note: Operations, for more
information on these operations.

   Also, since `tar' normally strips leading `/' from file names (Note:
absolute), a command like `tar --verify -cf /tmp/foo.tar /etc' will
work as desired only if the working directory is `/', as `tar' uses the
archive's relative member names (e.g., `etc/motd') when verifying the
archive.


automatically generated by info2www version 1.2.2.9