Go to the first, previous, next, last section, table of contents.


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. In multi-volume archives, each volume is verified after it is written, before the next volume is written.

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 explicitely 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. See section Comparing Archive Members with the File System.

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.


Go to the first, previous, next, last section, table of contents.