\chapter{Storage Daemon Configuration} \label{blb:StoredConfChapter} \index[general]{Storage Daemon Configuration} \index[general]{Configuration!Storage Daemon} The Storage Daemon configuration file has relatively few resource definitions. However, due to the great variation in backup media and system capabilities, the storage daemon must be highly configurable. As a consequence, there are quite a large number of directives in the Device Resource definition that allow you to define all the characteristics of your Storage device (normally a tape drive). Fortunately, with modern storage devices, the defaults are sufficient, and very few directives are actually needed. Examples of \textbf{Device} resource directives that are known to work for a number of common tape drives can be found in the \bdirectoryname{\bbracket{bacula-src}/examples/devices} directory, and most will also be listed here. For a general discussion of configuration file and resources including the data types recognized by \textbf{\bacula{}}, please see the \bilink{Configuration}{blb:ConfigureChapter} chapter of this manual. The following Storage Resource definitions must be defined: \begin{bitemize} \item \bilink{Storage}{blb:StorageResource2} -- to define the name of the Storage daemon. \item \bilink{Director}{blb:DirectorResource1} -- to define the Director's name and his access password. \item \bilink{Device}{blb:DeviceResource} -- to define the characteristics of your storage device (tape drive). \item \bilink{Messages}{blb:MessagesChapter} -- to define where error and information messages are to be sent. \end{bitemize} \section{Storage Resource} \label{blb:StorageResource2} \index[general]{Resource!Storage} \index[general]{Storage Resource} In general, the properties specified under the Storage resource define global properties of the Storage daemon. Each Storage daemon configuration file must have one and only one Storage resource definition. \begin{bdescription} \bwebdoc{Storage:Storage:Name} \item [Name = \bbracket{Storage-Daemon-Name}] \index[sd]{Name} \index[sd]{Directive!Name} Specifies the Name of the Storage daemon. This directive is required. \bwebdoc{Storage:Storage:WorkingDirectory} \item [Working Directory = \bbracket{Directory}] \index[sd]{Working Directory} \index[sd]{Directive!Working Directory} This directive is mandatory and specifies a directory in which the Storage daemon may put its status files. This directory should be used only by \textbf{\bacula{}}, but may be shared by other \bacula{} daemons provided the names given to each daemon are unique. This directive is required \bwebdoc{Storage:Storage:PidDirectory} \item [Pid Directory = \bbracket{Directory}] \index[sd]{Pid Directory} \index[sd]{Directive!Pid Directory} This directive is mandatory and specifies a directory in which the Storage daemon may put its process Id file files. The process Id file is used to shutdown \bacula{} and to prevent multiple copies of \bacula{} from running simultaneously. This directive is required. Standard shell expansion of the \textbf{Directory} is done when the configuration file is read so that values such as \textbf{\$HOME} will be properly expanded. Typically on Linux systems, you will set this to: \bdirectoryname{/var/run}. If you are not installing \bacula{} in the system directories, you can use the \textbf{Working Directory} as defined above. \bwebdoc{Storage:Storage:DedupDirectory} \item [Dedup Directory = \bbracket{Directory}] \index[sd]{Dedup Directory} \index[sd]{Directive!Dedup Directory} This directive is mandatory when using Global Endpoint Deduplication feature, and specifies a directory in which the Storage daemon may put data block files for all devices of the type \textbf{dedup}. The \textbf{Dedup Directory} can be very large after some point, we advise you to use a logical volume manager to be able to extend the filesystem when needed with new disks. Standard shell expansion of the \textbf{Directory} is done when the configuration file is read so that values such as \textbf{\$HOME} will be properly expanded. \bwebdoc{Storage:Storage:DedupIndexDirectory} \item [Dedup Index Directory = \bbracket{Directory}] \index[sd]{Dedup Index Directory} \index[sd]{Directive!Dedup Index Directory} This directive is optional and specifies a directory in which the Storage daemon may put its index files for all devices of the type \textbf{dedup}. Standard shell expansion of the \textbf{Directory} is done when the configuration file is read so that values such as \textbf{\$HOME} will be properly expanded. The default value is set to \bdefaultvalue{DedupDirectory} when set. \bwebdoc{Storage:Storage:HeartbeatInterval} \item [Heartbeat Interval = \bbracket{time-interval}] \index[sd]{Heartbeat Interval} \index[sd]{Directive!Heartbeat Interval} \index[general]{Heartbeat Interval} \index[general]{Broken pipe} This directive defines an interval of time in seconds. When the Storage daemon is waiting for the operator to mount a tape, each time interval, it will send a heartbeat signal to the File daemon. The default interval is \bdefaultvalue{300s}. This feature is particularly useful if you have a router such as 3Com that does not follow Internet standards and times out an valid connection after a short duration despite the fact that keepalive is set. This usually results in a broken pipe error message. \bwebdoc{Storage:Storage:ClientConnectWait} \item [Client Connect Wait = \bbracket{time-interval}] \index[sd]{Connect Wait} \index[sd]{Directive!Connect Wait} \index[general]{Client Connect Wait} This directive defines an interval of time in seconds that the Storage daemon will wait for a Client (the File daemon) to connect. The default is \bdefaultvalue{30 minutes}. Be aware that the longer the Storage daemon waits for a Client, the more resources will be tied up. \bwebdoc{Storage:Storage:MaximumConcurrentJobs} \item [Maximum Concurrent Jobs = \bbracket{number}] \index[sd]{Maximum Concurrent Jobs} \index[sd]{Directive!Maximum Concurrent Jobs} where \bbracket{number} is the maximum number of Jobs that may run concurrently. The default is set to \bdefaultvalue{20}, but you may set it to a larger number. Each contact from the Director (e.g. status request, job start request) is considered as a Job, so if you want to be able to do a \bcommandname{status} request in the console at the same time as a Job is running, you will need to set this value greater than 1. To run simultaneous Jobs, you will need to set a number of other directives in the Director's configuration file. Which ones you set depend on what you want, but you will almost certainly need to set the \textbf{Maximum Concurrent Jobs} in the Storage resource in the Director's configuration file and possibly those in the Job and Client resources. \bwebdoc{Storage:Storage:SDAddresses} \item [SDAddresses = \bbracket{IP-address-specification}] \index[sd]{SDAddresses} \index[sd]{Directive!SDAddresses} Specify the ports and addresses on which the Storage daemon will listen for Director connections. Normally, the default is sufficient and you do not need to specify this directive. Probably the simplest way to explain how this directive works is to show an example: \begin{bVerbatim} SDAddresses = { ip = { addr = 1.2.3.4; port = 1205; } ipv4 = { addr = 1.2.3.4; port = http; } ipv6 = { addr = 1.2.3.4; port = 1205; } ip = { addr = 1.2.3.4 port = 1205 } ip = { addr = 1.2.3.4 } ip = { addr = 201:220:222::2 } ip = { addr = bluedot.thun.net } } \end{bVerbatim} where ip, ip4, ip6, addr, and port are all keywords. Note, that the address can be specified as either a dotted quadruple, or IPv6 colon notation, or as a symbolic name (only in the ip specification). Also, port can be specified as a number or as the mnemonic value from the \bfilename{/etc/services} file. If a port is not specified, the default will be used. If an ip section is specified, the resolution can be made either by IPv4 or IPv6. If ip4 is specified, then only IPv4 resolutions will be permitted, and likewise with ip6. Using this directive, you can replace both the SDPort and SDAddress directives shown below. \bwebdoc{Storage:Storage:SdPort} \item [SDPort = \bbracket{port-number}] \index[sd]{SDPort} \index[sd]{Directive!SDPort} Specifies port number on which the Storage daemon listens for Director connections. The default is \bdefaultvalue{9103}. \bwebdoc{Storage:Storage:SdAddress} \item [SDAddress = \bbracket{IP-Address}] \index[sd]{SDAddress} \index[sd]{Directive!SDAddress} This directive is optional, and if it is specified, it will cause the Storage daemon server (for Director and File daemon connections) to bind to the specified \textbf{IP-Address}, which is either a domain name or an IP address specified as a dotted quadruple. If this directive is not specified, the Storage daemon will bind to any available address (the default). \bwebdoc{Storage:Storage:CommCompression} \item[CommCompression = \byesorno{}] \index[sd]{CommCompression} \index[sd]{Directive!CommCompression} \index[sd]{Compression} If the two \bacula{} components (DIR, FD, SD, bconsole) have the comm line compression enabled, the line compression will be enabled. The default value is yes. In many cases, the volume of data transmitted across the communications line can be reduced by a factor of three when this directive is \bdefaultvalue{enabled}. In the case that the compression is not effective, \bacula{} turns it off on a record by record basis. \smallskip If you are backing up data that is already compressed the comm line compression will not be effective, and you are likely to end up with an average compression ratio that is very small. In this case, \bacula{} reports \bvalue{None} in the Job report. \input{StorageStorageTls} \bwebdoc{Storage:Storage:End} \end{bdescription} The following is a typical Storage daemon Storage definition. \begin{bVerbatim} # # "Global" Storage daemon configuration specifications appear # under the Storage resource. # Storage { Name = "Storage daemon" Address = localhost WorkingDirectory = "~/bacula/working" Pid Directory = "~/bacula/working" } \end{bVerbatim} \section{Director Resource} \label{blb:DirectorResource1} \index[general]{Director Resource} \index[general]{Resource!Director} The Director resource specifies the Name of the Director which is permitted to use the services of the Storage daemon. There may be multiple Director resources. The Director Name and Password must match the corresponding values in the Director's configuration file. \begin{bdescription} \bwebdoc{Storage:Director:Name} \item [Name = \bbracket{Director-Name}] \index[sd]{Name} \index[sd]{Directive!Name} Specifies the Name of the Director allowed to connect to the Storage daemon. This directive is required. \bwebdoc{Storage:Director:Password} \item [Password = \bbracket{Director-password}] \index[sd]{Password} \index[sd]{Directive!Password} Specifies the password that must be supplied by the above named Director. This directive is required. \bwebdoc{Storage:Director:Monitor} \item [Monitor = \byesorno{}] \index[sd]{Monitor} \index[sd]{Directive!Monitor} If Monitor is set to \bdefaultvalue{no} (default), this director will have full access to this Storage daemon. If Monitor is set to \bvalue{yes}, this director will only be able to fetch the current status of this Storage daemon. Please note that if this director is being used by a Monitor, we highly recommend to set this directive to \bvalue{yes} to avoid serious security problems. \input{StorageDirectorTls} \bwebdoc{Storage:Director:End1} \end{bdescription} The following is an example of a valid Director resource definition: \begin{bVerbatim} Director { Name = MainDirector Password = my_secret_password } \end{bVerbatim} \label{blb:DeviceResource} \section{Device Resource} \index[general]{Resource!Device} \index[general]{Device Resource} The Device Resource specifies the details of each device (normally a tape drive) that can be used by the Storage daemon. There may be multiple Device resources for a single Storage daemon. In general, the properties specified within the Device resource are specific to the Device. \begin{bdescription} \bwebdoc{Storage:Device:Name} \item [Name = \bbracket{Device-Name}] \index[sd]{Name} \index[sd]{Directive!Name} Specifies the Name that the Director will use when asking to backup or restore to or from to this device. This is the logical Device name, and may be any string up to 127 characters in length. It is generally a good idea to make it correspond to the English name of the backup device. The physical name of the device is specified on the \textbf{Archive Device} directive described below. The name you specify here is also used in your Director's conf file on the \bilink{Device directive}{blb:StorageResource2} in its Storage resource. \bwebdoc{Storage:Device:ArchiveDevice} \item [Archive Device = \bbracket{name-string}] \index[sd]{Archive Device} \index[sd]{Directive!Archive Device} The specified \textbf{name-string} gives the system file name of the storage device managed by this storage daemon. This will usually be the device file name of a removable storage device (tape drive), for example \bfilename{/dev/nst0} or \bfilename{/dev/rmt/0mbn}. It may also be a directory name if you are archiving to disk storage. In this case, you must supply the full absolute path to the directory. When specifying a tape device, it is preferable that the "non-rewind" variant of the device file name be given. In addition, on systems such as Sun, which have multiple tape access methods, you must be sure to specify to use Berkeley I/O conventions with the device. The \textbf{b} in the Solaris (Sun) archive specification \bfilename{/dev/rmt/0mbn} is what is needed in this case. \bacula{} does not support SysV tape drive behavior. As noted above, normally the Archive Device is the name of a tape drive, but you may also specify an absolute path to an existing directory. If the Device is a directory \bacula{} will write to file storage in the specified directory, and the filename used will be the Volume name as specified in the Catalog. If you want to write into more than one directory (i.e. to spread the load to different disk drives), you will need to define two Device resources, each containing an Archive Device with a different directory. \label{blb:SetupFifo} In addition to a tape device name or a directory name, \bacula{} will accept the name of a FIFO. A FIFO is a special kind of file that connects two programs via kernel memory. If a FIFO device is specified for a backup operation, you must have a program that reads what \bacula{} writes into the FIFO. When the Storage daemon starts the job, it will wait for \textbf{MaximumOpenWait} seconds for the read program to start reading, and then time it out and terminate the job. As a consequence, it is best to start the read program at the beginning of the job perhaps with the \textbf{RunBeforeJob} directive. For this kind of device, you never want to specify \textbf{AlwaysOpen}, because you want the Storage daemon to open it only when a job starts, so you must explicitly set it to \bvalue{no}. Since a FIFO is a one way device, \bacula{} will not attempt to read a label of a FIFO device, but will simply write on it. To create a FIFO Volume in the catalog, use the \bcommandname{add} command rather than the \bcommandname{label} command to avoid attempting to write a label. \begin{bVerbatim} Device { Name = FifoStorage Media Type = Fifo Device Type = Fifo Archive Device = /tmp/fifo LabelMedia = yes Random Access = no AutomaticMount = no RemovableMedia = no MaximumOpenWait = 60 AlwaysOpen = no } \end{bVerbatim} During a restore operation, if the Archive Device is a FIFO, \bacula{} will attempt to read from the FIFO, so you must have an external program that writes into the FIFO. \bacula{} will wait \textbf{MaximumOpenWait} seconds for the program to begin writing and will then time it out and terminate the job. As noted above, you may use the \textbf{RunBeforeJob} to start the writer program at the beginning of the job. The Archive Device directive is required. \bwebdoc{Storage:Device:DeviceType} \item [Device Type = \bbracket{type-specification}] \index[sd]{Device Type} \index[sd]{Directive!Device Type} The Device Type specification allows you to explicitly tell \bacula{} what kind of device you are defining. It the \emph{type-specification} may be one of the following: \begin{bdescription} \item [File] Tells \bacula{} that the device is a file. It may either be a file defined on fixed medium or a removable filesystem such as USB. All files must be random access devices. \item [Tape] The device is a tape device and thus is sequential access. Tape devices are controlled using ioctl() calls. \item [Fifo] The device is a first-in-first out sequential access read-only or write-only device. \item [Aligned] Tells \bacula{} that the device is special Aligned Device. Please see the specific Aligned User's guide for more information. \item [Dedup] The device is a Deduplication device. The Storage Daemon will use the deduplication engine. Please see the specific Deduplication User's guide for more information. \item [Cloud] The device is a Cloud device. The Storage Daemon will use the Cloud to upload/download volumes. Please see the specific Cloud User's guide for more information. \end{bdescription} The Device Type directive is not required, and if not specified, \bacula{} will attempt to guess what kind of device has been specified using the Archive Device specification supplied. There are several advantages to explicitly specifying the Device Type. First, on some systems, block and character devices have the same type. Secondly, if you explicitly specify the Device Type, the mount point need not be defined until the device is opened. This is the case with most removable devices such as USB that are mounted by the HAL daemon. If the Device Type is not explicitly specified, then the mount point must exist when the Storage daemon starts. \bwebdoc{Storage:Device:Enabled} \item [Enabled = \byesorno{}] \index[sd]{Enabled} \index[sd]{Directive!Enabled} This directive allows you to enable or disable the \bresourcename{Device} resource. \bwebdoc{Storage:Device:MediaType} \item [Media Type = \bbracket{name-string}] \index[sd]{Media Type} \index[sd]{Directive!Media Type} The specified \textbf{name-string} names the type of media supported by this device, for example, "DLT7000". Media type names are arbitrary in that you set them to anything you want, but they must be known to the volume database to keep track of which storage daemons can read which volumes. In general, each different storage type should have a unique Media Type associated with it. The same \textbf{name-string} must appear in the appropriate Storage resource definition in the Director's configuration file. Even though the names you assign are arbitrary (i.e. you choose the name you want), you should take care in specifying them because the Media Type is used to determine which storage device \bacula{} will select during restore. Thus you should probably use the same Media Type specification for all drives where the Media can be freely interchanged. This is not generally an issue if you have a single Storage daemon, but it is with multiple Storage daemons, especially if they have incompatible media. For example, if you specify a Media Type of "DDS-4" then during the restore, \bacula{} will be able to choose any Storage Daemon that handles "DDS-4". If you have an autochanger, you might want to name the Media Type in a way that is unique to the autochanger, unless you wish to possibly use the Volumes in other drives. You should also ensure to have unique Media Type names if the Media is not compatible between drives. This specification is required for all devices. In addition, if you are using disk storage, each Device resource will generally have a different mount point or directory. In order for \bacula{} to select the correct Device resource, each one must have a unique Media Type. \bwebdoc{Storage:Device:Autochanger} \label{blb:Autochanger} \item [Autochanger = \byesorno{}] \index[sd]{Autochanger} \index[sd]{Directive!Autochanger} If \bvalue{yes}, this device belongs to an automatic tape changer, and you must specify an \textbf{Autochanger} resource that points to the \textbf{Device} resources. You must also specify a \textbf{Changer Device}. If the Autochanger directive is set to \bdefaultvalue{no} (default), the volume must be manually changed. You should also have an identical directive to the \bilink{Storage resource}{blb:Autochanger1} in the Director's configuration file so that when labeling tapes you are prompted for the slot. \bwebdoc{Storage:Device:ChangerDevice} \item [Changer Device = \bbracket{name-string}] \index[sd]{Changer Device} \index[sd]{Directive!Changer Device} The specified \textbf{name-string} must be the \textbf{generic SCSI} device name of the autochanger that corresponds to the normal read/write \textbf{Archive Device} specified in the Device resource. This generic SCSI device name should be specified if you have an autochanger or if you have a standard tape drive and want to use the \textbf{Alert Command} (see below). For example, on Linux systems, for an Archive Device name of \bfilename{/dev/nst0}, you would specify \bfilename{/dev/sg0} for the Changer Device name. Depending on your exact configuration, and the number of autochangers or the type of autochanger, what you specify here can vary. This directive is optional. See the \bilink{ Using Autochangers}{blb:AutochangersChapter} chapter of this manual for more details of using this and the following autochanger directives. \bwebdoc{Storage:Device:ChangerCommand} \item [Changer Command = \bbracket{name-string}] \index[sd]{Changer Command} \index[sd]{Directive!Changer Command} The \textbf{name-string} specifies an external program to be called that will automatically change volumes as required by \textbf{\bacula{}}. Normally, this directive will be specified only in the \textbf{AutoChanger} resource, which is then used for all devices. However, you may also specify the different \textbf{Changer Command} in each Device resource. Most frequently, you will specify the \bacula{} supplied \mtxchanger{} script as follows: \begin{bVerbatim} Changer Command = "/path/mtx-changer %c %o %S %a %d" \end{bVerbatim} and you will install the \btool{mtx} on your system (found in the \textbf{depkgs} release). An example of this command is in the default \bfilename{bacula-sd.conf} file. For more details on the substitution characters that may be specified to configure your autochanger please see the \bilink{Autochangers}{blb:AutochangersChapter} chapter of this manual. For FreeBSD users, you might want to see one of the several \btool{chio} scripts in \bdirectoryname{examples/autochangers}. \bwebdoc{Storage:Device:ControlDevice} \item [Control Device = \bbracket{name-string}] \index[sd]{Control Device} The control device is the \acs{SCSI} control device that corresponds to the \bdirectivename{Archive Device}. The correspondance can be done via the \btool{lssci -g} command. \begin{bVerbatim} /opt/bacula# lsscsi -g [1:0:0:0] tape HP Ultrium 4-SCSI H61W /dev/st0 /dev/sg0 [1:0:0:1] tape HP Ultrium 4-SCSI H61W /dev/st1 /dev/sg1 [1:0:0:2] mediumx HP MSL G3 Series E.00 - /dev/sg2 \end{bVerbatim} \bwebdoc{Storage:Device:AlertCommand} \item [Alert Command = \bbracket{name-string}] \index[sd]{Alert Command} The \textbf{name-string} specifies an external program to be called at the completion of each Job after the device is released. The purpose of this command is to check for Tape Alerts, which are present when something is wrong with your tape drive (at least for most modern tape drives). The same substitution characters that may be specified in the Changer Command may also be used in this string. For more information, please see the \bilink{Autochangers}{blb:AutochangersChapter} chapter of this manual. The directive in the Device resource can call the \btool{tapealert} script that is installed in the scripts directory. It is defined as follows: \begin{bVerbatim} Device { Name = ... Archive Device = /dev/nst0 Alert Command = "/opt/bacula/scripts/tapealert %l" Control Device = /dev/sg1 # must be SCSI ctl for /dev/nst0 ... } \end{bVerbatim} Once the above mentioned two directives (\bdirectivename{Alert Command} and \bdirectivename{Control Device}) are in place in each of your \bresourcename{Device} resources, \bacula{} will check for tape alerts at two points: \begin{bitemize} \item After the Drive is used and it becomes idle. \item After each read or write error on the drive. \end{bitemize} At each of the above times, \bacula{} will call the new \btool{tapealert} script, which uses the \btool{tapeinfo} program. The \btool{tapeinfo} utility is part of the \btool{apt} \texttt{sg3-utils} and \btool{rpm} \texttt{sg3\_utils} packages. Then for each tape alert that \bacula{} finds for that drive, it will emit a Job message that is either \texttt{INFO}, \texttt{WARNING}, or \texttt{FATAL} depending on the designation in the \bfootref{http://www.t10.org}{Tape Alert published by the T10 Technical Committee on SCSI Storage Interfaces}. For the specification, please see: \url{http://www.t10.org/ftp/t10/document.02/02-142r0.pdf} \bwebdoc{Storage:Device:WormCommand} \item [Worm Command = \bbracket{name-string}] \index[sd]{Worm Command} The \bvalue{name-string} specifies an external program to be called when loading a new volume. The purpose of this command is to check if the current tape is a \acs{WORM}\footnote{\acl{WORM}} tape. The same substitution characters that may be specified in the \bdirectivename{Changer Command} ay also be used in this string. The directive in the \bresourcename{Device} resource can call the \btool{isworm} script that is installed in the scripts directory. It is defined as follows: \begin{bVerbatim} Device { Name = ... Archive Device = /dev/nst0 Worm Command = "/opt/bacula/scripts/isworm %l" Control Device = /dev/sg1 # must be SCSI ctl for /dev/nst0 ... } \end{bVerbatim} \bacula{} will call the \btool{isworm} script, which uses the \btool{tapeinfo} and \btool{sdparm} program. \bwebdoc{Storage:Device:DriveIndex} \item [Drive Index = \bbracket{number}] \index[sd]{Drive Index} \index[sd]{Directive!Drive Index} The \textbf{Drive Index} that you specify is passed to the \mtxchanger{} script and is thus passed to the \mtx{} program. By default, the Drive Index is \bdefaultvalue{zero}, so if you have only one drive in your autochanger, everything will work normally. However, if you have multiple drives, you must specify multiple \bacula{} Device resources (one for each drive). The first Device should have the Drive Index set to 0, and the second Device Resource should contain a Drive Index set to 1, and so on. This will then permit you to use two or more drives in your autochanger. As of \bacula{} version 1.38.0, using the \textbf{Autochanger} resource, \bacula{} will automatically ensure that only one drive at a time uses the autochanger script, so you no longer need locking scripts as in the past -- the default \mtxchanger{} script works for any number of drives. \bwebdoc{Storage:Device:Autoselect} \item [Autoselect = \byesorno{}] \index[sd]{Autoselect} \index[sd]{Directive!Autoselect} If this directive is set to \bdefaultvalue{yes} (default), and the Device belongs to an autochanger, then when the Autochanger is referenced by the Director, this device can automatically be selected. If this directive is set to \bvalue{no}, then the Device can only be referenced by directly using the Device name in the Director. This is useful for reserving a drive for something special such as a high priority backup or restore operations. \bwebdoc{Storage:Device:MaximumConcurrentJobs} \item[Maximum Concurrent Jobs = \bbracket{num}] \index[sd]{MaximumConcurrentJobs} \index[sd]{Directive!MaximumConcurrentJobs} \bdirectivename{Maximum Concurrent Jobs} is a directive that permits setting the maximum number of Jobs that can run concurrently on a specified Device. Using this directive, it is possible to have different Jobs using multiple drives, because when the Maximum Concurrent Jobs limit is reached, the Storage Daemon will start new Jobs on any other available compatible drive. This facilitates writing to multiple drives with multiple Jobs that all use the same Pool. \bwebdoc{Storage:Device:MaximumChangerWait} \item [Maximum Changer Wait = \bbracket{time}] \index[sd]{Maximum Changer Wait} \index[sd]{Directive!Maximum Changer Wait} This directive specifies the maximum time in seconds for \bacula{} to wait for an autochanger to change the volume. If this time is exceeded, \bacula{} will invalidate the Volume slot number stored in the catalog and try again. If no additional changer volumes exist, \bacula{} will ask the operator to intervene. The default is \bdefaultvalue{5 minutes}. % TODO: if this is the format, then maybe "5 minutes" should be in % TODO: quotes? define style. see others. \bwebdoc{Storage:Device:MaximumRewindWait} \item [Maximum Rewind Wait = \bbracket{time}] \index[sd]{Maximum Rewind Wait} \index[sd]{Directive!Maximum Rewind Wait} This directive specifies the maximum time in seconds for \bacula{} to wait for a rewind before timing out. If this time is exceeded, \bacula{} will cancel the job. The default is \bdefaultvalue{5 minutes}. \bwebdoc{Storage:Device:MaximumOpenWait} \item [Maximum Open Wait = \bbracket{time}] \index[sd]{Maximum Open Wait} \index[sd]{Directive!Maximum Open Wait} This directive specifies the maximum time in seconds that \bacula{} will wait for a device that is busy. The default is \bdefaultvalue{5 minutes}. If the device cannot be obtained, the current Job will be terminated in error. \bacula{} will re-attempt to open the drive the next time a Job starts that needs the the drive. \bwebdoc{Storage:Device:AlwaysOpen} \item [Always Open = \byesorno{}] \index[sd]{Always Open} \index[sd]{Directive!Always Open} If \bdefaultvalue{yes} (default), \bacula{} will always keep the device open unless specifically \textbf{unmounted} by the Console program. This permits \bacula{} to ensure that the tape drive is always available, and properly positioned. If you set \textbf{AlwaysOpen} to \bvalue{no}, \textbf{\bacula{}} will only open the drive when necessary, and at the end of the Job if no other Jobs are using the drive, it will be freed. The next time \bacula{} wants to append to a tape on a drive that was freed, \bacula{} will rewind the tape and position it to the end. To avoid unnecessary tape positioning and to minimize unnecessary operator intervention, it is highly recommended that \textbf{Always Open = yes}. This also ensures that the drive is available when \bacula{} needs it. If you have \textbf{Always Open = yes} (recommended) and you want to use the drive for something else, simply use the \bcommandname{unmount} command in the Console program to release the drive. However, don't forget to remount the drive with \bcommandname{mount} when the drive is available or the next \bacula{} job will block. For File storage, this directive is ignored. For a FIFO storage device, you must set this to \bvalue{no}. Please note that if you set this directive to \bvalue{no} \bacula{} will release the tape drive between each job, and thus the next job will rewind the tape and position it to the end of the data. This can be a very time consuming operation. In addition, with this directive set to no, certain multiple drive autochanger operations will fail. We strongly recommend to keep \textbf{Always Open} set to \bvalue{yes} \bwebdoc{Storage:Volume:VolumePollInterval} \item [Volume Poll Interval = \bbracket{time}] \index[sd]{Volume Poll Interval} \index[sd]{Directive!Volume Poll Interval} If the time specified on this directive is non-zero, after asking the operator to mount a new volume \bacula{} will periodically poll (or read) the drive at the specified interval to see if a new volume has been mounted. If the time interval is zero, no polling will occur. The default value is \bdefaultvalue{5 mins}. This directive can be useful if you want to avoid operator intervention via the console. Instead, the operator can simply remove the old volume and insert the requested one, and \bacula{} on the next poll will recognize the new tape and continue. Please be aware that if you set this interval too small, you may excessively wear your tape drive if the old tape remains in the drive, since \bacula{} will read it on each poll. This can be avoided by ejecting the tape using the \textbf{Offline On Unmount} and the \textbf{Close on Poll} directives. However, if you are using a Linux 2.6 kernel or other OSes such as FreeBSD or Solaris, the Offline On Unmount will leave the drive with no tape, and \bacula{} will not be able to properly open the drive and may fail the job. For more information on this problem, please see the \bxlink{description of Offline On Unmount}{blb:NoTapeInDrive}{problems}{subsection} in the \bxlink{Tape Testing}{blb:TapeTestingChapter}{problems}{chapter} of the \bproblemman{}. \bwebdoc{Storage:Device:CloseOnPoll} \item [Close on Poll = \byesorno{}] \index[sd]{Close on Poll} \index[sd]{Directive!Close on Poll} If \bvalue{yes}, \bacula{} close the device (equivalent to an unmount except no mount is required) and reopen it at each poll. Normally this is not too useful unless you have the \textbf{Offline on Unmount} directive set, in which case the drive will be taken offline preventing wear on the tape during any future polling. Once the operator inserts a new tape, \bacula{} will recognize the drive on the next poll and automatically continue with the backup. Please see above more more details. \bwebdoc{Storage:Device:SyncOnClose} \item [Sync On Close = \byesorno{}] \index[sd]{Sync On Close} \index[sd]{Directive!Sync On Close} If \bvalue{yes}, \bacula{} will sync the device at the end of each job and when closing the device. Normally it might be useful if you store the data on network filesystems. The default value is \bvalue{yes}. \bwebdoc{Storage:Device:SetVolumeImmutable} \item [Set Volume Immutable = \byesorno{}] \index[sd]{Directive!Set Volume Immutable} Warning: Only for file-based devices. This feature can only be used if Bacula is run as a systemd service because only then, with proper capabilities set for the daemon, it's allowed to manage Volume Files' attributes. If \bvalue{yes}, this device sets the 'Immutable' file attribute for each volume when setting it's status to 'Full'. Attribute is cleared when the volume is relabeled/truncated. When this directive is set and the volume is Full, there is no other way than to wait for the 'MinimumVolumeProtectionTime' to expire so that the volume can be relabeled/reused. Note that Immutable flag is set only for Full volumes, setting it for other statuses (e.g. 'Used' volumes) is not currently supported. The default is \bdefaultvalue{no}. \bwebdoc{Storage:Device:SetVolumeAppendOnly} \item [Set Volume Append Only = \byesorno{}] \index[sd]{Directive!Set Volume Append Only} Warning: Only for file-based devices. This feature can only be used if Bacula is run as a systemd service because only then, with proper capabilities set for the daemon, it's allowed to manage Volume Files' attributes. If \bvalue{yes}, this device sets the 'Append\_Only' file attribute for each volume that is created (either automatically or using the label command), at the moment of writing first backup job. Attribute is cleared when the volume is relabeled/truncated. Note that the flag is set when Bacula actually uses volume for the first time, not when the volume is labelled (either automatically or using the `label` command). The default is \bdefaultvalue{no}. \bwebdoc{Storage:Device:MinimumVolumeProtectionTime} \item [Minimum Volume Protection Time = \bbracket{time-interval}] \index[sd]{Directive!Minimum Volume Protection Time} Warning: Only for file-based devices. This feature can only be used if Bacula is run as a systemd service because only then, with proper capabilities set for the daemon, it's allowed to manage Volume Files' attributes. This directive defines an interval of time in which the Storage Daemon respects the 'Immutable' file attribute which is set when marking volume as Full. Bacula won't allow relabeling or reusing such a volume before this period expires. When this directive is set to 0, the drive device will not be able to truncate/relabel volumes at all, effectively keeping volumes all the time for further usage. The default is \bdefaultvalue{30 days}. \bwebdoc{Storage:Device:MaximumOpenWait} \item [Maximum Open Wait = \bbracket{time}] \index[sd]{Maximum Open Wait} \index[sd]{Directive!Maximum Open Wait} This directive specifies the maximum amount of time in seconds that \bacula{} will wait for a device that is busy. The default is \bdefaultvalue{5 minutes}. If the device cannot be obtained, the current Job will be terminated in error. \bacula{} will re-attempt to open the drive the next time a Job starts that needs the the drive. \bwebdoc{Storage:Device:RemovableMedia} \label{blb:removablemedia} \item [Removable Media = \byesorno{}] \index[sd]{Removable media} \index[sd]{Directive!Removable media} If \bvalue{yes}, this device supports removable media (for example, tapes or CDs). If \bvalue{no}, media cannot be removed (for example, an intermediate backup area on a hard disk). If \textbf{Removable media} is enabled on a File device (as opposed to a tape) the Storage daemon will assume that device may be something like a USB device that can be removed or a simply a removable harddisk. When attempting to open such a device, if the Volume is not found (for File devices, the Volume name is the same as the Filename), then the Storage daemon will search the entire device looking for likely Volume names, and for each one found, it will ask the Director if the Volume can be used. If so, the Storage daemon will use the first such Volume found. Thus it acts somewhat like a tape drive -- if the correct Volume is not found, it looks at what actually is found, and if it is an appendable Volume, it will use it. If the removable medium is not automatically mounted (e.g. udev), then you might consider using additional Storage daemon device directives such as \textbf{Requires Mount}, \textbf{Mount Point}, \textbf{Mount Command}, and \textbf{Unmount Command}, all of which can be used in conjunction with \textbf{Removable Media}. \bwebdoc{Storage:Device:RandomAccess} \item [Random Access = \byesorno{}] \index[sd]{Random access} \index[sd]{Directive!Random access} If \bvalue{yes}, the archive device is assumed to be a random access medium which supports the \textbf{lseek} (or \textbf{lseek64} if Largefile is enabled during configuration) facility. This should be set to \bvalue{yes} for all file systems such as USB, and fixed files. It should be set to \bvalue{no} for non-random access devices such as tapes and named pipes. \bwebdoc{Storage:Device:RequiresMount} \item [Requires Mount = \byesorno{}] \index[sd]{Requires Mount } When this directive is enabled, the Storage daemon will submit a \textbf{Mount Command} before attempting to open the device. You must set this directive to \bvalue{yes} for removable file systems such as USB devices that are not automatically mounted by the operating system when plugged in or opened by \bacula{}. It should be set to \bvalue{no} for all other devices such as tapes and fixed filesystems. It should also be set to \bvalue{no} for any removable device that is automatically mounted by the operating system when opened (e.g. USB devices mounted by udev or hotplug). This directive indicates if the device requires to be mounted using the \textbf{Mount Command}. To be able to write devices need a mount, the following directives must also be defined: \textbf{Mount Point}, \textbf{Mount Command}, and \textbf{Unmount Command}. \bwebdoc{Storage:Device:MountPoint} \item [Mount Point = \bbracket{directory}] \index[sd]{Mount Point} Directory where the device can be mounted. This directive is used only for devices that have \textbf{Requires Mount} enabled such as USB file devices. \bwebdoc{Storage:Device:MountCommand} \item [Mount Command = \bbracket{name-string}] \index[sd]{Mount Command} This directive specifies the command that must be executed to mount devices such as many USB devices. Before the command is executed, \%a is replaced with the Archive Device, and \%m with the Mount Point. See the \bilink{Edit Codes}{blb:mountcodes} section below for more details of the editing codes that can be used in this directive. If you need to specify multiple commands, create a shell script. \bwebdoc{Storage:Device:UnmountCommand} \item [Unmount Command = \bbracket{name-string}] \index[sd]{Unmount Command} This directive specifies the command that must be executed to unmount devices such as many USB devices. Before the command is executed, \%a is replaced with the Archive Device, and \%m with the Mount Point. Most frequently, you will define it as follows: \begin{bVerbatim} Unmount Command = "/bin/umount %m" \end{bVerbatim} See the \bilink{Edit Codes}{blb:mountcodes} section below for more details of the editing codes that can be used in this directive. If you need to specify multiple commands, create a shell script. \bwebdoc{Storage:Device:BlockChecksum} \item[Block Checksum = \byesorno{}] \index[sd]{Directive!Block Checksum} You may turn off the Block Checksum (CRC32) code that \bacula{} uses when writing blocks to a Volume. Doing so can reduce the Storage daemon CPU usage slightly. It will also permit \bacula{} to read a Volume that has corrupted data. The default is \bdefaultvalue{yes} -- i.e. the checksum is computed on write and checked on read. \textbf{We do not recommend to turn this off} particularly on older tape drives or for disk Volumes where doing so may allow corrupted data to go undetected. \bwebdoc{Storage:Device:MinimumBlockSize} \item [Minimum block size = \bbracket{size-in-bytes}] \index[sd]{Minimum block size} \index[sd]{Directive!Minimum block size} On most modern tape drives, you will not need or want to specify this directive, and if you do so, it will be to make \bacula{} use fixed block sizes. This statement applies only to non-random access devices (e.g. tape drives). Blocks written by the storage daemon to a non-random archive device will never be smaller than the given \textbf{size-in-bytes}. The Storage daemon will attempt to efficiently fill blocks with data received from active sessions but will, if necessary, add padding to a block to achieve the required minimum size. To force the block size to be fixed, as is the case for some non-random access devices (tape drives), set the \textbf{Minimum block size} and the \textbf{Maximum block size} to the same value (zero included). The default is that both the minimum and maximum block size are \bdefaultvalue{zero} and the default block size is \bdefaultvalue{64,512 bytes}. For example, suppose you want a fixed block size of 100K bytes, then you would specify: \begin{bVerbatim} Minimum block size = 100K Maximum block size = 100K \end{bVerbatim} Please note that if you specify a fixed block size as shown above, the tape drive must either be in variable block size mode, or if it is in fixed block size mode, the block size (generally defined by \btool{mt}) \textbf{must} be identical to the size specified in \bacula{} -- otherwise when you attempt to re-read your Volumes, you will get an error. If you want the block size to be variable but with a 64K minimum and \bdefaultvalue{200K} maximum (and default as well), you would specify: \begin{bVerbatim} Minimum block size = 64K Maximum blocksize = 256K \end{bVerbatim} \bwebdoc{Storage:Device:MaximumBlockSize} \item [Maximum block size = \bbracket{size-in-bytes}] \index[sd]{Maximum Block Size} \index[sd]{Directive!Maximum block size} On most modern tape drives, you will not need to specify this directive. If you do so, it will most likely be to reduce shoe-shine and improve performance on more modern LTO drives. The Storage daemon will always attempt to write blocks of the specified \textbf{size-in-bytes} to the archive device. As a consequence, this statement specifies both the default block size and the maximum block size. The size written never exceeds the given \textbf{size-in-bytes}. If adding data to a block would cause it to exceed the given maximum size, the block will be written to the archive device, and the new data will begin a new block. If no value is specified or zero is specified, the Storage daemon will use a default block size of \bdefaultvalue{64,512 bytes} (126 * 512). The maximum \textbf{size-in-bytes} possible is 4,000,000. \bwebdoc{Storage:Device:HardwareEndOfMedium} \item [Hardware End of Medium = \byesorno{}] \index[sd]{Hardware End of Medium} \index[sd]{Directive!Hardware End of Medium} If \bvalue{no}, the archive device is not required to support end of medium ioctl request, and the storage daemon will use the forward space file function to find the end of the recorded data. If \bvalue{yes}, the archive device must support the {\tt ioctl} {\tt MTEOM} call, which will position the tape to the end of the recorded data. In addition, your SCSI driver must keep track of the file number on the tape and report it back correctly by the \textbf{MTIOCGET} ioctl. Note, some SCSI drivers will correctly forward space to the end of the recorded data, but they do not keep track of the file number. On Linux machines, the SCSI driver has a \textbf{fast-eod} option, which if set will cause the driver to lose track of the file number. You should ensure that this option is always turned off using the \btool{mt} program. Default setting for Hardware End of Medium is \bdefaultvalue{yes}. This function is used before appending to a tape to ensure that no previously written data is lost. We recommend if you have a non-standard or unusual tape drive that you use the \btool{btape} program to test your drive to see whether or not it supports this function. All modern (after 1998) tape drives support this feature. \bwebdoc{Storage:Device:FastForwardSpaceFile} \item [Fast Forward Space File = \byesorno{}] \index[sd]{Fast Forward Space File} \index[sd]{Directive!Fast Forward Space File} If \bvalue{no}, the archive device is not required to support keeping track of the file number (\textbf{MTIOCGET} ioctl) during forward space file. If \bvalue{yes}, the archive device must support the {\tt ioctl} {\tt MTFSF} call, which virtually all drivers support, but in addition, your SCSI driver must keep track of the file number on the tape and report it back correctly by the \textbf{MTIOCGET} ioctl. Note, some SCSI drivers will correctly forward space, but they do not keep track of the file number or more seriously, they do not report end of medium. Default setting for Fast Forward Space File is \bdefaultvalue{yes}. \bwebdoc{Storage:Device:UseMtiocget} \item [Use MTIOCGET = \byesorno{}] \index[sd]{Use MTIOCGET} \index[sd]{Directive!Use MTIOCGET} If \bvalue{no}, the operating system is not required to support keeping track of the file number and reporting it in the (\textbf{MTIOCGET} ioctl). The default is \bdefaultvalue{yes}. If you must set this to No, \bacula{} will do the proper file position determination, but it is very unfortunate because it means that tape movement is very inefficient. Fortunately, this operation system deficiency seems to be the case only on a few *BSD systems. Operating systems known to work correctly are Solaris, Linux and FreeBSD. \bwebdoc{Storage:Device:BsfAtEom} \item [BSF at EOM = \byesorno{}] \index[sd]{BSF at EOM} \index[sd]{Directive!BSF at EOM} If \bdefaultvalue{no}, the default, no special action is taken by \bacula{} with the End of Medium (end of tape) is reached because the tape will be positioned after the last EOF tape mark, and \bacula{} can append to the tape as desired. However, on some systems, such as FreeBSD, when \bacula{} reads the End of Medium (end of tape), the tape will be positioned after the second EOF tape mark (two successive EOF marks indicated End of Medium). If \bacula{} appends from that point, all the appended data will be lost. The solution for such systems is to specify \textbf{BSF at EOM} which causes \bacula{} to backspace over the second EOF mark. Determination of whether or not you need this directive is done using the \bcommandname{test} command in the \btool{btape} program. \bwebdoc{Storage:Device:TwoEof} \item [TWO EOF = \byesorno{}] \index[sd]{TWO EOF} \index[sd]{Directive!TWO EOF} If \bvalue{yes}, \bacula{} will write two end of file marks when terminating a tape -- i.e. after the last job or at the end of the medium. If \bdefaultvalue{no}, the default, \bacula{} will only write one end of file to terminate the tape. \bwebdoc{Storage:Device:BackwardSpaceRecord} \item [Backward Space Record = \byesorno{}] \index[sd]{Backward Space Record} \index[sd]{Directive!Backward Space Record} If \bvalue{yes}, the archive device supports the {\tt MTBSR ioctl} to backspace records. If \bvalue{no}, this call is not used and the device must be rewound and advanced forward to the desired position. Default is \bdefaultvalue{yes} for non random-access devices. This function if enabled is used at the end of a Volume after writing the end of file and any ANSI/IBM labels to determine whether or not the last block was written correctly. If you turn this function off, the test will not be done. This causes no harm as the re-read process is precautionary rather than required. \bwebdoc{Storage:Device:BackwardSpaceFile} \item [Backward Space File = \byesorno{}] \index[sd]{Backward Space File} \index[sd]{Directive!Backward Space File} If \bvalue{yes}, the archive device supports the \textbf{MTBSF} and \textbf{MTBSF ioctl}s to backspace over an end of file mark and to the start of a file. If \bvalue{no}, these calls are not used and the device must be rewound and advanced forward to the desired position. Default is \bdefaultvalue{yes} for non random-access devices. \bwebdoc{Storage:Device:ForwardSpaceRecord} \item [Forward Space Record = \byesorno{}] \index[sd]{Forward Space Record} \index[sd]{Directive!Forward Space Record} If \bvalue{yes}, the archive device must support the \textbf{MTFSR ioctl} to forward space over records. If \bvalue{no}, data must be read in order to advance the position on the device. Default is \bdefaultvalue{yes} for non random-access devices. \bwebdoc{Storage:Device:ForwardSpaceFile} \item [Forward Space File = \byesorno{}] \index[sd]{Forward Space File} \index[sd]{Directive!Forward Space File} If \bvalue{yes}, the archive device must support the \texttt{MTFSF ioctl} to forward space by file marks. If \bvalue{no}, data must be read to advance the position on the device. Default is \bdefaultvalue{yes} for non random-access devices. \bwebdoc{Storage:Device:OfflineOnUnmount} \item [Offline On Unmount = \byesorno{}] \index[sd]{Offline On Unmount} \index[sd]{Directive!Offline On Unmount} The default for this directive is \bdefaultvalue{no}. If \bvalue{yes} the archive device must support the {\tt MTOFFL ioctl} to rewind and take the volume offline. In this case, \bacula{} will issue the offline (eject) request before closing the device during the \bcommandname{unmount} command. If \bvalue{no} \bacula{} will not attempt to offline the device before unmounting it. After an offline is issued, the cassette will be ejected thus \textbf{requiring operator intervention} to continue, and on some systems require an explicit load command to be issued (\btool{mt -f /dev/xxx load}) before the system will recognize the tape. If you are using an autochanger, some devices require an offline to be issued prior to changing the volume. However, most devices do not and may get very confused. If you are using a Linux 2.6 kernel or other OSes such as FreeBSD or Solaris, the Offline On Unmount will leave the drive with no tape, and \bacula{} will not be able to properly open the drive and may fail the job. For more information on this problem, please see the \bxlink{description of Offline On Unmount}{blb:NoTapeInDrive}{problems}{subsection} in the \bxlink{Tape Testing}{blb:TapeTestingChapter}{problems}{chapter} of the \bproblemman{}. \bwebdoc{Storage:Device:MaximumVolumeSize} \item [Maximum Volume Size = \bbracket{size}] \index[sd]{Maximum Volume Size} \index[sd]{Directive!Maximum Volume Size} No more than \textbf{size} bytes will be written onto a given volume on the archive device. This directive is used mainly in testing \bacula{} to simulate a small Volume. It can also be useful if you wish to limit the size of a File Volume to say less than 2GB of data. In some rare cases of really antiquated tape drives that do not properly indicate when the end of a tape is reached during writing (though I have read about such drives, I have never personally encountered one). Please note, this directive is deprecated (being phased out) in favor of the \textbf{Maximum Volume Bytes} defined in the Director's configuration file. \bwebdoc{Storage:Device:MaximumFileSize} \item [Maximum File Size = \bbracket{size}] \index[sd]{Maximum File Size} \index[sd]{Directive!Maximum File Size} No more than \textbf{size} bytes will be written into a given logical file on the volume. Once this size is reached, an end of file mark is written on the volume and subsequent data are written into the next file. Breaking long sequences of data blocks with file marks permits quicker positioning to the start of a given stream of data and can improve recovery from read errors on the volume. The default is \bdefaultvalue{one Gigabyte}. This directive creates \acs{EOF} marks only on tape media. However, regardless of the medium type (tape, disk, USB ...) each time a the Maximum File Size is exceeded, a record is put into the catalog database that permits seeking to that position on the medium for restore operations. If you set this to a small value (e.g. 1MB), you will generate lots of database records (JobMedia) and may significantly increase CPU/disk overhead. If you are configuring an LTO-3 or LTO-4 tape, you probably will want to set the \bdirectivename{Maximum File Size} to \bvalue{2GB} to avoid making the drive stop to write an \acs{EOF} mark. Note, this directive does not limit the size of Volumes that \bacula{} will create regardless of whether they are tape or disk volumes. It changes only the number of EOF marks on a tape and the number of block positioning records (see below) that are generated. If you want to limit the size of all Volumes for a particular device, use the \bdirectivename{Maximum Volume Size} directive (above), or use the \bdirectivename{Maximum Volume Bytes} directive in the Director's Pool resource, which does the same thing but on a Pool (Volume) basis. \bwebdoc{Storage:Device:MaximumFileIndex} \item [Maximum File Index = \bbracket{size}] \index[sd]{Maximum File Index} \index[sd]{Directive!Maximum File Index} Some data might include information about the actual position of a block in the data stream. This information is stored in the catalog inside the \btable{FileMedia} table. By default, one index record will be created every 100MB of data. The index permits quicker positioning to the start of a given block in the \bacula{} Volume and can improve the Single Item Restore feature. If you set this to a small value (e.g. 1MB), you will generate lots of database records (FileMedia) and may significantly increase \acs{CPU}/disk overhead. \bwebdoc{Storage:Device:MaximumPartSize} \item [Maximum Part Size = \bbracket{size}] \index[sd]{Maximum Part Size} \index[sd]{Directive!Maximum Part Size} This directive allows one to specify the maximum size for each part. Smaller part sizes will reduce restore costs, but may require a small additional overhead to handle multiple parts. The maximum number of parts permitted in a Cloud Volume is \bvalue{524,288}. The maximum size of any given part is approximately 17.5TB. \bwebdoc{Storage:Device:BlockPositioning} \item [Block Positioning = \byesorno{}] \index[sd]{Block Positioning} \index[sd]{Directive!Block Positioning} This directive tells \bacula{} not to use block positioning when doing restores. Turning this directive off can cause \bacula{} to be \textbf{extremely} slow when restoring files. You might use this directive if you wrote your tapes with \bacula{} in variable block mode (the default), but your drive was in fixed block mode. The default is \bdefaultvalue{yes}. \bwebdoc{Storage:Device:MaximumNetworkBufferSize} \item [Maximum Network Buffer Size = \bbracket{bytes}] \index[sd]{Maximum Network Buffer Size} \index[sd]{Directive!Maximum Network Buffer Size} where \emph{bytes} specifies the initial network buffer size to use with the File daemon. This size will be adjusted down if it is too large until it is accepted by the OS. Please use care in setting this value since if it is too large, it will be trimmed by 512 bytes until the OS is happy, which may require a large number of system calls. The default value is \bdefaultvalue{32,768} bytes. The maximum value is \bvalue{1,000,000} bytes. The default size was chosen to be relatively large but not too big in the case that you are transmitting data over Internet. It is clear that on a high speed local network, you can increase this number and improve performance. For example, some users have found that if you use a value of 65,536 bytes they get five to ten times the throughput. Larger values for most users don't seem to improve performance. If you are interested in improving your backup speeds, this is definitely a place to experiment. You will probably also want to make the corresponding change in each of your File daemons conf files. \bwebdoc{Storage:Device:MaximumSpoolSize} \item [Maximum Spool Size = \bbracket{bytes}] \index[sd]{Maximum Spool Size} \index[sd]{Directive!Maximum Spool Size} where the bytes specify the maximum spool size for all jobs that are running. The default is \bdefaultvalue{no limit}. \bwebdoc{Storage:Device:MaximumJobSpoolSize} \item [Maximum Job Spool Size = \bbracket{bytes}] \index[sd]{Maximum Job Spool Size} \index[sd]{Directive!Maximum Job Spool Size} where the bytes specify the maximum spool size for any one job that is running. The default is \bdefaultvalue{no limit}. This directive is implemented only in version 1.37 and later. \bwebdoc{Storage:Device:SpoolDirectory} \item [Spool Directory = \bbracket{directory}] \index[sd]{Spool Directory} \index[sd]{Directive!Spool Directory} specifies the name of the directory to be used to store the spool files for this device. This directory is also used to store temporary part files when writing to a device that requires mount (USB). The default is to use the \bdefaultvalue{working directory}. \bwebdoc{Storage:Device:UseLintape} \item [Use LinTape = \byesorno{}] \index[sd]{Use Lintape} \index[sd]{Directive!Use Lintape} If \bvalue{yes}, the archive device must use the \texttt{IBM Lintape} Kernel interface instead of the standard \texttt{ST} Linux Kernel module. The \texttt{Use MTIOCGET = No} should be used when using the Lintape module. The default is \bdefaultvalue{no}, the use of the default \texttt{ST} Linux Kernel module is recommended. \end{bdescription} % comes from the newbsfeature, but we need also to generate bweb documentation \section{Cloud Resource} The Cloud Storage Driver must be installed in the \bacula{} Storage Daemon \bdirectivename{Plugin Directory} to be used. \begin{bdescription} \label{Storage:Cloud:Name} \item [Name = \bbracket{Device-Name}] \index[sd]{Name} \index[sd]{Directive!Name} The name of the Cloud resource. This is the logical Cloud name, and may be any string up to 127 characters in length.% Shown as \textbf{S3Cloud} above. \label{Storage:Cloud:Description} \item [Description = \bbracket{Text}] The description is used for display purposes as is the case with all resource. \label{Storage:Cloud:Driver} \item [Driver = \bbracket{DriverName}] \index[sd]{Driver} This defines which driver to use. It can be \bvalue{S3} or \bvalue{Amazon}. There is also a \bvalue{File} driver, which is used mostly for testing. \label{Storage:Cloud:HostName} \item [Host Name = \bbracket{Name}] \index[sd]{HostName} This directive specifies the hostname to be used in the \acs{URL}. Each Cloud service provider has a different and unique hostname. The maximum size is 255 characters and may contain a \acs{TCP} port specification. This directive is not used with Azure cloud. \label{Storage:Cloud:BucketName} \item [Bucket Name = \bbracket{Name}] \index[sd]{BucketName} This directive specifies the bucket name that you wish to use on the Cloud service. This name is normally a unique name that you create on the cloud service that identifies where you want to place your Cloud Volumes. The maximum bucket name size is 255 characters. \label{Storage:Cloud:AccessKey} \item [Access Key = \bbracket{String}] \index[sd]{AccessKey} The access key is your unique user identifier given to you by your cloud service provider. \label{Storage:Cloud:SecretKey} \item [Secret Key = \bbracket{String}] \index[sd]{SecretKey} The secret key is the security key that was given to you by your cloud service provider. It is equivalent to a password. \label{Storage:Cloud:Protocol} \item [Protocol = \bbracket{HTTP | HTTPS}] \index[sd]{Protocol} The protocol defines the communications protocol to use with the cloud service provider. The two protocols currently supported are: \acs{HTTPS} and \acs{HTTP}. The default is \acs{HTTPS}. \label{Storage:Cloud:UriStyle} \item [Uri Style = \bbracket{VirtualHost | Path}] \index[sd]{UriStyle} This directive specifies the \acs{URI} style to use to communicate with the cloud service provider. The two \bdirectivename{Uri Styles} currently supported are: \bvalue{VirtualHost} and \bvalue{Path}. The default is \bdefaultvalue{VirtualHost}. \label{Storage:Cloud:TruncateCache} \item [Truncate Cache = \bbracket{Truncate-kw}] \index[sd]{TruncateCache} This directive specifies when \bacula{} should automatically remove (truncate) the local cache parts. Local cache parts can only be removed if they have been uploaded to the cloud. The currently implemented values are: \begin{bdescription} \item [ No ] Do not remove cache. With this option you must manually delete the cache parts with a \bconsolename{} \bcommandname{truncate cache} command, or do so with an \textbf{Admin} Job that runs an \bcommandname{truncate cache} command. This is the default. \item [ AfterUpload ] Each part will be removed just after it is uploaded. Note, if this option\footnote{Not yet implemented.} is specified, all restores will require a download from the Cloud. \item [ AtEndOfJob ] With this option\footnote{Note yet implemented/}, at the end of the Job, every part that has been uploaded to the Cloud will be removed (truncated). \end{bdescription} \label{Storage:Cloud:Upload} \item [Upload = \bbracket{Upload-kw}] This directive specifies when local cache parts will be uploaded to the Cloud. The options are: \begin{bdescription} \item [ No ] Do not upload cache parts. With this option you must manually upload the cache parts with a \bconsolename{} \bcommandname{upload} command, or do so with an \textbf{Admin} Job that runs an \bcommandname{upload} command. This is the default. \item [ EachPart ] With this option, each part will be uploaded when it is complete i.e. when the next part is created or at the end of the Job. \item [ AtEndOfJob ] With this option\footnote{Not implemented yet.} all parts that have not been previously uploaded will be uploaded at the end of the Job. \end{bdescription} \label{Storage:Cloud:MaximumConcurrentUploads} \item [Maximum Concurrent Uploads = \bbracket{number}] The default is \bdefaultvalue{3}, but by using this directive, you may set it to any value you want. \label{Storage:Cloud:MaximumConcurrentDownloads} \item [Maximum Concurrent Downloads = \bbracket{number}] The default is \bdefaultvalue{3}, but by using this directive, you may set it to any value you want. \label{Storage:Cloud:MaximumUploadBandwidth} \item [Maximum Upload Bandwidth = \bbracket{speed}] The default is \bdefaultvalue{unlimited}, but by using this directive, you may limit the upload bandwidth used globally by all devices referencing this Cloud resource. \label{Storage:Cloud:MaximumDownloadBandwidth} \item [Maximum Download Bandwidth = \bbracket{speed}] The default is \bdefaultvalue{unlimited}, but by using this directive, you may limit the download bandwidth used globally by all devices referencing this Cloud resource. \label{Storage:Cloud:Region} \item [Region = \bbracket{String}] The Cloud resource can be configured to use a specific endpoint within a region. This directive is required for AWS-V4 regions. ex: \bvalueddirective{Region}{"eu-central-1"} \end{bdescription} An example of a Cloud Resource might be: \begin{bVerbatim} Cloud { Name = AWSCloud Driver = "Amazon" HostName = "s3.amazonaws.com" BucketName = "BaculaVolumes" AccessKey = "BZIXAIS39DYNER5FZ" SecretKey = "beesheeg7iTe0Gaex7aedie4aWohfuewohGaa0" Protocol = HTTPS UriStyle = VirtualHost Truncate Cache = No Upload = EachPart Region = "us-east-1" MaximumUploadBandwidth = 5MB/s } \end{bVerbatim} \begin{bdescription} \label{Storage:Cloud:TransferPriority} \item [Transfer Priority = \bbracket{High | Medium | Low}] When restoring directly a part from Glacier, this directive indicates the rehydration priority level. Values can be \textbf{High}, \textbf{Medium} or \textbf{Low}. Default is \textbf{High}. Those values match respectively \textbf{Expeditive}, \textbf{Standard} and \textbf{Bulk} transfers tiers within S3. \label{Storage:Cloud:TransferRetention} \item [Transfer Retention = \bbracket{time-period-specification}] This directive indicates the number of days S3 should keep the rehydrated part online. The minimum value is 1 day. The default is 5 days. \end{bdescription} \label{blb:mountcodes} \section{Edit Codes for Mount and Unmount Directives} \index[general]{Directives!Edit Codes} \index[general]{Edit Codes for Mount and Unmount Directives } Before submitting the \textbf{Mount Command}, \textbf{Unmount Command}, \textbf{Write Part Command}, or \textbf{Free Space Command} directives to the operating system, \bacula{} performs character substitution of the following characters: \begin{bVerbatim} %% = % %a = Archive device name %e = erase (set if cannot mount and first part) %n = part number %m = mount point %v = last part name (i.e. filename) \end{bVerbatim} \section{Devices that require a mount (USB)} \index[general]{Devices that require a mount (USB)} All the directives in this section are implemented only in \bacula{} version 1.37 and later and hence are available in version 1.38.6. As of version 1.39.5, the directives ``Requires Mount'', ``Mount Point'', ``Mount Command'', and ``Unmount Command'' apply to removable filesystems such as USB. \begin{bdescription} \bwebdoc{Storage:Device:RequiresMount} \item [Requires Mount = \byesorno{}] \index[sd]{Requires Mount} \index[sd]{Directive!Requires Mount} You must set this directive to \bvalue{yes} for removable devices such as USB unless they are automounted, and to \bvalue{no} for all other devices (tapes/files). This directive indicates if the device requires to be mounted to be read, and if it must be written in a special way. If it set, \textbf{Mount Point}, \textbf{Mount Command}, \textbf{Unmount Command} directives must also be defined. \bwebdoc{Storage:Device:MountPoint} \item [Mount Point = \bbracket{directory}] \index[sd]{Mount Point} \index[sd]{Directive!Mount Point} Directory where the device can be mounted. \bwebdoc{Storage:Device:MountCommand} \item [Mount Command = \bbracket{name-string}] \index[sd]{Mount Command} \index[sd]{Directive!Mount Command} Command that must be executed to mount the device. Before the command is executed, \%a is replaced with the Archive Device, and \%m with the Mount Point. Most frequently, you will define it as follows: \begin{bVerbatim} Mount Command = "/bin/mount -t iso9660 -o ro %a %m" \end{bVerbatim} For some media, you may need multiple commands. If so, it is recommended that you use a shell script instead of putting them all into the Mount Command. For example, instead of this: \begin{bVerbatim} Mount Command = "/usr/local/bin/mymount" \end{bVerbatim} Where that script contains: \begin{bVerbatim} #!/bin/sh ndasadmin enable -s 1 -o w sleep 2 mount /dev/ndas-00323794-0p1 /backup \end{bVerbatim} Similar consideration should be given to all other Command parameters. \bwebdoc{Storage:Device:UnmountCommand} \item [Unmount Command = \bbracket{name-string}] \index[sd]{Unmount Command} \index[sd]{Directive!Unmount Command} Command that must be executed to unmount the device. Before the command is executed, \%a is replaced with the Archive Device, and \%m with the Mount Point. Most frequently, you will define it as follows: \begin{bVerbatim} Unmount Command = "/bin/umount %m" \end{bVerbatim} If you need to specify multiple commands, create a shell script. \end{bdescription} %% This pulls in the Autochanger resource from another file. \label{blb:AutochangerRes} \label{blb:AutochangerResource1} \input{autochangerres} \section{Capabilities} \index[general]{Capabilities} \begin{bdescription} \bwebdoc{Storage:Device:LabelMedia} \item [Label Media = \byesorno{}] \index[general]{Label Media} \index[sd]{Label Media} \index[sd]{Directive!Label Media} If \bvalue{yes}, permits this device to automatically label blank media without an explicit operator command. It does so by using an internal algorithm as defined on the \bilink{Label Format}{blb:Label} record in each Pool resource. If this is \bdefaultvalue{no} as by default, \bacula{} will label tapes only by specific operator command (\bcommandname{label} in the Console) or when the tape has been recycled. The automatic labeling feature is most useful when writing to disk rather than tape volumes. \bwebdoc{Storage:Device:AutomaticMount} \item [Automatic mount = \byesorno{}] \index[sd]{Automatic mount} \index[sd]{Directive!Automatic mount} If \bdefaultvalue{yes} (the default), permits the daemon to examine the device to determine if it contains a \bacula{} labeled volume. This is done initially when the daemon is started, and then at the beginning of each job. This directive is particularly important if you have set \textbf{Always Open = no} because it permits \bacula{} to attempt to read the device before asking the system operator to mount a tape. However, please note that the tape must be mounted before the job begins. \end{bdescription} \section{Messages Resource} \label{blb:MessagesResource1} \index[general]{Resource!Messages} \index[general]{Messages Resource} For a description of the Messages Resource, please see the \bilink{Messages Resource}{blb:MessagesChapter} Chapter of this manual. \bwebdoc{SDStatisticsResource} \section{The Statistics Resource} \index[general]{Resource!Statistics} \index[general]{Statistics Resource} The \bresourcename{Statistics} Resource defines the statistic collector function that can send information to a Graphite instance, to a \acs{CSV} file or to bconsole with the \bcommandname{statistics} command (See \vref{blb:StatisticsCommand} for more information). \begin{bdescription} \item [Statistics] \index[dir]{Statistics} \index[dir]{Directive!Statistics} Start of the \bresourcename{Statistics} resource. Statistics directives are optional. \bwebdoc{Storage:Statistics:Name} \item [Name = \bbracket{name}] \index[dir]{Name} \index[dir]{Directive!Name} The Statistics directive \bdirectivename{name} is used by the system administrator. This directive is required. \bwebdoc{Storage:Statistics:Description} \item [Description = \bbracket{string}] \index[dir]{Description} \index[dir]{Directive!Description} The text field contains a description of the \bresourcename{Statistics} resource that will be displayed in the graphical user interface. This directive is optional. \bwebdoc{Storage:Statistics:Interval} \item [Interval = \bbracket{time-interval}] \index[dir]{Interval} \index[dir]{Directive!Interval} \index[dir]{Directive!Interval} The \bdirectivename{Intervall} directive instructs the Statistics collector thread how long it should sleep between every collection iteration. This directive is optional and the default value is \bdefaultvalue{300} seconds. \bwebdoc{Storage:Statistics:Type} \item [Type = \bbracket{CSV|Graphite}] \index[dir]{Type} \index[dir]{Directive!Type} The \bdirectivename{Type} directive specifies the Statistics backend, which may be one of the following: \bvalue{\acs{CSV}} or \bvalue{Graphite}. This directive is required. \smallskip \acs{CSV} is a simple file level backend which saves all required metrics with the following format to the file: ``\bbracket{time}, \bbracket{metric}, \bbracket{value}\textbackslash{}n'' Where \bbracket{time} is a standard Unix time (a number of seconds from 1/01/1970) with local timezone as returned by a system call \btool{time()}, \bbracket{metric} is a Bacula metric string and \bbracket{value} is a metric value which could be in numeric format (\texttt{int}/\texttt{float}) or a string \bvalue{True} or \bvalue{False} for boolean variable. The \acs{CSV} backend requires the \bvalueddirective{File}{~} parameter. \smallskip Graphite is a network backend which will send all required metrics to a Graphite server. The Graphite backend requires the \bvalueddirective{Host}{~} and \bvalueddirective{Port}{~} directives to be set. If the Graphite server is not available, the metrics are automatically spooled in the working directory. When the server can be reached again, spooled metrics are despooled automatically and the spooling function is suspended. \bwebdoc{Storage:Statistics:Metrics} \item [Metrics = \bbracket{metricspec}] \index[dir]{Metrics} \index[dir]{Directive!Metrics} The \bdirectivename{Metrics} directive allow metric filtering and \bbracket{metricspec} is a filter which enables to use \bvalue{*} and \bvalue{?} characters to match the required metric name in the same way as found in shell wildcard resolution. You can exclude filtered metric with \bvalue{!} prefix. You can define any number of filters for a single Statistics. Metrics filter is executed in order as found in configuration. This directive is optional and if not used all available metrics will be saved by this collector backend. \smallskip Example: \begin{bVerbatim} # Include all metric starting with "bacula.jobs" Metrics = "bacula.jobs.*" # Exclude any metric starting with "bacula.jobs" Metrics = "!bacula.jobs.*" \end{bVerbatim} \bwebdoc{Storage:Statistics:Prefix} \item [Prefix = \bbracket{string}] \index[dir]{Prefix} \index[dir]{Directive!Prefix} The \bdirectivename{Prefix} allows to alter the metrics name saved by collector to distinguish between different installations or daemons. The prefix string will be added to metric name as: ``\bbracket{prefix}.\bbracket{metric\_name}'' This directive is optional. \bwebdoc{Storage:Statistics:Prefix} \item [File = \bbracket{filename}] \index[dir]{File} \index[dir]{Directive!File} The \bdirectivename{File} is used by the \acs{CSV} collector backend and point to the full path and filename of the file where metrics will be saved. With the \acs{CSV} type, the \bdirectivename{File} directive is required. The collector thread must have the permissions to write to the selected file or create a new file if the file doesn't exist. If collector is unable to write to the file or create a new one then the collection terminates and an error message will be generated. The file is only open during the dump and is closed otherwise. Statistics file rotation could be executed by a \btool{mv} shell command. \bwebdoc{Storage:Statistics:Host} \item [Host = \bbracket{hostname}] \index[dir]{Host} \index[dir]{Directive!Host} The \bdirectivename{Host} directive is used for Graphite backend and specify the hostname or the \acs{IP} address of the Graphite server. When the directive Type is set to Graphite, the Host directive is required. \bwebdoc{Storage:Statistics:Port} \item [Host = \bbracket{number}] \index[dir]{Port} \index[dir]{Directive!Port} The \bdirectivename{Port} directive is used for Graphite backend and specify the \acs{TCP} port number of the Graphite server. When the directive Type is set to Graphite, the \bdirectivename{Port} directive is required. \bwebdoc{Storage:Statistics:End} \end{bdescription} \section{Sample Storage Daemon Configuration File} \label{blb:SampleConfiguration} \index[general]{File!Sample Storage Daemon Configuration} \index[general]{Sample Storage Daemon Configuration File} A example Storage Daemon configuration file might be the following: %%\footnotesize \begin{bVerbatim} # # Default Bacula Storage Daemon Configuration file # # For Bacula release 1.37.2 (07 July 2005) -- gentoo 1.4.16 # # You may need to change the name of your tape drive # on the "Archive Device" directive in the Device # resource. If you change the Name and/or the # "Media Type" in the Device resource, please ensure # that bacula-dir.conf has corresponding changes. # Storage { # definition of myself Name = rufus-sd Address = rufus WorkingDirectory = "$HOME/bacula/bin/working" Pid Directory = "$HOME/bacula/bin/working" Maximum Concurrent Jobs = 20 } # # List Directors who are permitted to contact Storage daemon # Director { Name = rufus-dir Password = "ZF9Ctf5PQoWCPkmR3s4atCB0usUPg+vWWyIo2VS5ti6k" } # # Restricted Director, used by tray-monitor to get the # status of the storage daemon # Director { Name = rufus-mon Password = "9usxgc307dMbe7jbD16v0PXlhD64UVasIDD0DH2WAujcDsc6" Monitor = yes } # # Devices supported by this Storage daemon # To connect, the Director's bacula-dir.conf must have the # same Name and MediaType. # Autochanger { Name = Autochanger Device = Drive-1 Device = Drive-2 Changer Command = "/opt/bacula/scripts/mtx-changer %c %o %S %a %d" Changer Device = /dev/sg0 } Device { Name = Drive-1 # Drive Index = 0 Media Type = DLT-8000 Archive Device = /dev/nst0 AutomaticMount = yes; # when device opened, read it AlwaysOpen = yes; RemovableMedia = yes; RandomAccess = no; AutoChanger = yes Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'" } Device { Name = Drive-2 # Drive Index = 1 Media Type = DLT-8000 Archive Device = /dev/nst1 AutomaticMount = yes; # when device opened, read it AlwaysOpen = yes; RemovableMedia = yes; RandomAccess = no; AutoChanger = yes Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'" } Device { Name = "HP DLT 80" Media Type = DLT8000 Archive Device = /dev/nst0 AutomaticMount = yes; # when device opened, read it AlwaysOpen = yes; RemovableMedia = yes; } #Device { # Name = SDT-7000 # # Media Type = DDS-2 # Archive Device = /dev/nst0 # AutomaticMount = yes; # when device opened, read it # AlwaysOpen = yes; # RemovableMedia = yes; #} #Device { # Name = Floppy # Media Type = Floppy # Archive Device = /mnt/floppy # RemovableMedia = yes; # Random Access = Yes; # AutomaticMount = yes; # when device opened, read it # AlwaysOpen = no; #} #Device { # Name = FileStorage # Media Type = File # Archive Device = /tmp # LabelMedia = yes; # lets Bacula label unlabeled media # Random Access = Yes; # AutomaticMount = yes; # when device opened, read it # RemovableMedia = no; # AlwaysOpen = no; #} # # A very old Exabyte with no end of media detection # #Device { # Name = "Exabyte 8mm" # Media Type = "8mm" # Archive Device = /dev/nst0 # Hardware end of medium = No; # AutomaticMount = yes; # when device opened, read it # AlwaysOpen = Yes; # RemovableMedia = yes; #} # # Send all messages to the Director, # mount messages also are sent to the email address # Messages { Name = Standard director = rufus-dir = all operator = root = mount } \end{bVerbatim}