label
Label a tape.
Synopsis
label [storage=<storage>] [sd=<sd>] [volume=<volume>] [pool=<pool>]
[slot=<slot>[,...]] [catalog=<catalog>] [slots=<slots>] [drive=<drive>]
[barcodes] [barcode] [encrypt] [yes] [device=<device>]
Words without brackets are required, [ ] marks optional parts, a | b alternatives, ... a repeatable argument and [,...] a comma separated list.
Description
Writes a Bareos label onto a new medium (file or tape) through the Storage Daemon and creates the matching Media record in the catalog. Only a labelled volume can be used for backups. The command changes both the medium and the catalog. Missing values are asked for: storage, volume name, slot and pool.
Volume names may contain letters, digits and :.-_/ but must not start with /. slot= greater than 0 also sets the InChanger flag; on an autochanger without slot= the Director asks for the slot. drive= selects the drive and defaults to 0. encrypt creates a new key for hardware (LTO) encryption and stores it in the catalog.
barcodes labels every volume of an autochanger with the name read from its barcode; slots= restricts this to a slot list such as 1-5,8, and yes answers the confirmation question. Only autochanger storages qualify.
Arguments
| Argument | Type | Values / source | Default | Flags | Description |
|---|---|---|---|---|---|
storage= | resource | from .storages | Storage name. | ||
sd= | resource | from .storages | Storage name (as storage=). | ||
volume= | string | Volume name. | |||
pool= | resource | from .pools | Pool name. | ||
slot= | string | list | Slot. | ||
catalog= | resource | from .catalogs | Catalog name. | ||
slots= | string | Slots (list or ranges). | |||
drive= | integer | Drive number. | |||
barcodes | keyword | Use the barcodes as names. | |||
barcode | keyword | Use the barcodes as names. | |||
encrypt | keyword | Encrypt. | |||
yes | keyword | Do not ask. | |||
device= | string | Device name. |
Examples
Label one file volume into pool Full:
label storage=File volume=Full-0001 pool=Full
Label slots 1 to 5 with their barcodes, without asking:
label barcodes storage=Autochanger pool=Scratch slots=1-5 yes