Go to the previous, next section.

Special Options for Archiving

(This message will disappear, once this node revised.)

To give the archive a name which will be recorded in it, use the `--label=archive-label' (`-V archive-label') option. This will write a special record identifying volume-label as the name of the archive to the front of the archive which will be displayed when the archive is listed with `--list' (`-t'). If you are creating a multi-volume archive with `--multi-volume' (`-M') (

FIXME: pxref Using Multiple Tapes
), then the volume label will have `Volume nnn' appended to the name you give, where nnn is the number of the volume of the archive. (If you use the `--label=archive-label' (`-V archive-label') option when reading an archive, it checks to make sure the label on the tape matches the one you give.

FIXME: xref Special Options for Archiving

Files in the filesystem occasionally have "holes." A hole in a file is a section of the file's contents which was never written. The contents of a hole read as all zeros. On many operating systems, actual disk storage is not allocated for holes, but they are counted in the length of the file. If you archive such a file, tar could create an archive longer than the original. To have tar attempt to recognize the holes in a file, use `--sparse' (`-S'). When you use the `--sparse' (`-S') option, then, for any file using less disk space than would be expected from its length, tar searches the file for consecutive stretches of zeros. It then records in the archive for the file where the consecutive stretches of zeros are, and only archives the "real contents" of the file. On extraction (using `--sparse' (`-S') is not needed on extraction) any such files have hols created wherever the continuous stretches of zeros were found. Thus, if you use `--sparse' (`-S'), tar archives won't take more space than the original.

When tar reads files, this causes them to have the access times updated. To have tar attempt to set the access times back to what they were before they were read, use the `--atime-preserve' option. This doesn't work for files that you don't own, unless you're root, and it doesn't interact with incremental dumps nicely (

FIXME: pxref Making Backups
), but it is good enough for some purposes.

Go to the previous, next section.