Copyright (C) 2000-2012 |
GNU Info (tar.info)labelIncluding a Label in the Archive ================================ _(This message will disappear, once this node revised.)_ `-V NAME' `--label=NAME' Create archive with volume name NAME. This option causes `tar' to write out a "volume header" at the beginning of the archive. If `--multi-volume' (`-M') is used, each volume of the archive will have a volume header of `NAME Volume N', where N is 1 for the first volume, 2 for the next, and so on. To avoid problems caused by misplaced paper labels on the archive media, you can include a "label" entry--an archive member which contains the name of the archive--in the archive itself. Use the `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option in conjunction with the `--create' (`-c') operation to include a label entry in the archive as it is being created. If you create an archive using both `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') and `--multi-volume' (`-M'), each volume of the archive will have an archive label of the form `ARCHIVE-LABEL Volume N', where N is 1 for the first volume, 2 for the next, and so on. If you list or extract an archive using `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL'), `tar' will print an error if the archive label doesn't match the ARCHIVE-LABEL specified, and will then not list nor extract the archive. In those cases, ARCHIVE-LABEL argument is interpreted as a globbing-style pattern which must match the actual magnetic volume label. Note: exclude, for a precise description of how match is attempted(1). If the switch `--multi-volume' (`-M') is being used, the volume label matcher will also suffix ARCHIVE-LABEL by ` Volume [1-9]*' if the initial match fails, before giving up. Since the volume numbering is automatically added in labels at creation time, it sounded logical to equally help the user taking care of it when the archive is being read. The `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') was once called `--volume', but is not available under that name anymore. To find out an archive's label entry (or to find out if an archive has a label at all), use `tar --list --verbose'. `tar' will print the label first, and then print archive member information, as in the example below: $ tar --verbose --list --file=iamanarchive V--------- 0 0 0 1992-03-07 12:01 iamalabel--Volume Header-- -rw-rw-rw- ringo user 40 1990-05-21 13:30 iamafilename `--label=ARCHIVE-LABEL' `-V ARCHIVE-LABEL' Includes an "archive-label" at the beginning of the archive when the archive is being created, when used in conjunction with the `--create' (`-c') option. Checks to make sure the archive label matches the one specified (when used in conjunction with the `--extract' (`--get', `-x') option. To get a common information on all tapes of a series, use the `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option. For having this information different in each series created through a single script used on a regular basis, just manage to get some date string as part of the label. For example: $ tar cfMV /dev/tape "Daily backup for `date +%Y-%m-%d`" $ tar --create --file=/dev/tape --multi-volume \ --volume="Daily backup for `date +%Y-%m-%d`" Also note that each label has its own date and time, which corresponds to when GNU `tar' initially attempted to write it, often soon after the operator launches `tar' or types the carriage return telling that the next tape is ready. Comparing date labels does give an idea of tape throughput only if the delays for rewinding tapes and the operator switching them were negligible, which is usually not the case. ---------- Footnotes ---------- (1) Previous versions of `tar' used full regular expression matching, or before that, only exact string matching, instead of wildcard matchers. We decided for the sake of simplicity to use a uniform matching device through `tar'. automatically generated by info2www version 1.2.2.9 |