
#include "bacula_template.inc" title="Director Configuration" num=5.1

<h1>Configuring the Director</h1>
Of all the configuration files needed to run <b>Bacula</b>, the
Director's is the most complicated, and the one that you
will need to modify the most often as you add clients or modify
the FileSets.
<p>For a general discussion of configuration file and resources
including the data types recognized by <b>Bacula</b>, please
see the <a href="configure.html">Configuration</a> chapter of this
manual.

<h2>Director Resource Types</h2>
Director resource type may be one of the following:
<p class="tty">Job, Client, Storage, Catalog, Schedule, FileSet, Pool, Director,
             or Messages.</p>

We present them here in the most logical order
for defining them:     
<ul> 
  <li><a href="#DirectorResource">Director</a> -- to
      define the Director's name and its access password used for
      authenticating the Console program. Only a single
      Director resource definition may appear in the Director's
      configuration file.</li>
  <li><a href="#JobResource">Job</a> -- to define the backup/restore Jobs
      and to tie together the Client, FileSet and Schedule resources to
      be used for each Job.</li>
  <li><a href="#ScheduleResource">Schedule</a> -- to define when a Job is to
       be automatically run by <b>Bacula's</b> internal scheduler.</li> 
  <li><a href="#FileSetResource">FileSet</a> -- to define the set of files
      to be backed up for each Client.  </li>
  <li><a href="#ClientResource">Client</a> -- to define what Client is
      to be backed up.</li> 
  <li><a href="#StorageResource">Storage</a> -- to define on what
       physical device the Volumes should be mounted.  </li>
  <li><a href="dirdconf.html#PoolResource">Pool</a> -- to define what
      the pool of Volumes that can be used for a particular Job.  </li>
  <li><a href="#CatalogResource">Catalog</a> -- to define in what database to
      keep the list of files and the Volume names where they are backed up.
      </li>
  <li><a href="messagesres.html">Messages</a> -- to define where error
      and information messages are to be sent or logged.  </li>
</ul>


<h1><a name="DirectorResource">The Director Resource</a></h1>
The Director resource defines the attributes of the Directors running on
the network. In the current implementation, there is only a single Director
resource, but the final design will contain multiple Directors to maintain
index and media database redundancy. 
<dl>
<dt>Director</dt><dd>Start of the Director records. One and only one
    director resource must be supplied.</dd>
    </dd>
<dt>Name = &lt;name&gt;</dt><dd>The director name used by the system
     administrator. This record is required.
     </dd>
<dt>Description = &lt;text&gt;</dt><dd>The text field contains a
    description of the Director that will be displayed in the
    graphical user interface. This record is optional.
    </dd>
<dt>Password = &lt;UA-password&gt;</dt><dd>Specifies the password that
    must be supplied for a Bacula Console to be authorized.  The same
    password must appear in the <b>Director</b> resource of the Console
    configuration file.  For added security, the password is never
    actually passed across the network but rather a challenge response
    hash code created with the password.  This record is required.
    </dd>
<dt>Messages = &lt;Messages-resource-name&gt;</dt><dd>The messages resource
   specifies where to deliver Director messages that are not associated
   with a specific Job. Most messages are specific to a job and will
   be directed to the Messages resource specified by the job. However,
   there are a few messages that can occur when no job is running.
   This record is required.
   </dd>
<dt>Working Directory = &lt;Directory&gt;</dt><dd>This directive
   is mandatory and specifies a directory in which the Director 
   may put its status files. This directory should be used only
   by <b>Bacula</b> but may be shared by other Bacula daemons.
   Standard shell expansion of the <b>Directory</b>
   is done when the configuration file is read so that values such
   as <b>$HOME</b> will be properly expanded. This record is required.
   </dd>
<dt>Pid Directory = &lt;Directory&gt;</dt><dd>This directive
   is mandatory and specifies a directory in which the Director 
   may put its process Id file files. The process Id file is used to 
   shutdown <b>Bacula</b> and to prevent multiple copies of
   <b>Bacula</b> from running simultaneously.
   Standard shell expansion of the <b>Directory</b>
   is done when the configuration file is read so that values such
   as <b>$HOME</b> will be properly expanded. 
   <p>Typically on Linux systems, you will set this to:  
   <b>/var/run</b>. If you are not installing <b>Bacula</b> in the
   system directories, you can use the <b>Working Directory</b> as
   defined above. 
   This record is required. 
   </dd>
<dt>SubSys Directory = &lt;Directory&gt;</dt><dd>This directive
   is mandatory and specifies a directory in which the Director 
   may put its subsystem lock files. This
   record is required. Standard shell expansion of the <b>Directory</b>
   is done when the configuration file is read so that values such
   as <b>$HOME</b> will be properly expanded.
   <p>Typically on Linux systems, you will set this to:  
   <b>/var/run/subsys</b>. If you are not installing <b>Bacula</b> in the
   system directories, you can use the <b>Working Directory</b> as
   defined above. <b>Take care that you do not set this to the
   same directory that contains your binary files or they will be
   deleted.</b>
   This record is required. 
   </dd>

<dt>QueryFile = &lt;Path&gt;</dt><dd>This directive
   is mandatory and specifies a directory and file in which the Director
   can find the canned SQL statements for the <b>Query</b> command of
   the Console.  Standard shell expansion of the <b>Path</b> is done
   when the configuration file is read so that values such as
   <b>$HOME</b> will be properly expanded.  This record is required.
   </dd>

<a name="DirMaxConJobs"></a>
<dt>Maximum Concurrent Jobs = &lt;number&gt;</dt><dd>where &lt;number&gt;
   is the maximum number of total Director Jobs that should run concurrently. The
   default is set to 1, but you may set it to a larger number. Note
   however, at this time (Bacula version 1.30), multiple simultaneous
   jobs have not been heavily tested.     
   <p>Because this feature is not yet well tested, we recommend that you
   either set it to 1 or make careful tests to ensure that everything
   you want works, and at a mimimum keep all your Storage maximum
   simlutaneous job limits to 1 (see discussed below). 
   The Volume format becomes much more complicated with
   multiple simultaneous jobs, and not all the utility programs (e.g.
   <b>bextract</b>, ... have been properly updated to deal with more
   than one Job at a time to the same Volume).<b>BE WARNED!!!!</b> 
   <p>At the current time, there is no configuration parameter   
   set or limit the number console connections. A maximum of five
   simultaneous console connections are permitted.
   <p>
   Note that <b>Maximum Concurrent Jobs</b> is implemented in the
   Director, Job, Client, and Storage resources. Each one is independent
   of the others, and all limits from each of those resources must
   be met before a Job can run.  There should be no problems increasing
   the <b>Maximum Concurrent Jobs</b> in the Director, Client, and
   Job resources. However, we strongly recommend that you always
   set <b>Maximum Concurrent Jobs = 1</b> in each Storage
   definition.  This will ensure that only one job is writing to any
   single Volume at one time.  By setting the Storage <b>Maximum
   Concurrent Jobs</b> to one, and the Director's limit greater than
   one, you can safely run multiple simultaneous jobs with each writing to a
   different Volume providing you have multiple Storage definitions --
   that is either multiple tape drives, or you are writing to separate
   file Volumes.
   </dd>

<dt>FD Connect Timeout = &lt;time&gt;</dt><dd> where <b>time</b> 
   is the time in seconds that the Director should continue attempting
   to contact the File daemon to start a job, and after which the
   Director will cancel the job. The default is 30 minutes.</dd>

<dt>SD Connect Timeout = &lt;time&gt;</dt><dd> where <b>time</b> 
   is the time in seconds that the Director should continue attempting
   to contact the Storage daemon to start a job, and after which the
   Director will cancel the job. The default is 30 minutes.</dd>

<dt>DIRport = &lt;port-number&gt;</dt><dd>Specify the port (a positive
   integer) on which the
   Director daemon will listen for Bacula Console connections.
   This same port number must be specified in the Director resource
   of the Console configuration file. The default is 9101, so
   normally this record need not be specified. </dd>

<dt>DirAddress = &lt;IP-Address&gt;</dt><dd>This record is optional,
   and if it is specified, it will cause the Director server (for
   the Console program) to bind to the specified <b>IP-Address</b>,
   which is either a domain name or an IP address specified as a
   dotted quadruple in string or quoted string format.  
   If this record is not specified, the Director
   will bind to any available address (the default). </dd>
</dl>

<p>
The following is an example of a valid Director resource definition:
<pre>
Director {
  Name = HeadMan
  WorkingDirectory = "$HOME/bacula/bin/working"
  Password = UA_password
  PidDirectory = "$HOME/bacula/bin/working"
  SubSysDirectory = "$HOME/bacula/bin/working"
  QueryFile = "$HOME/bacula/bin/query.sql"
  Messages = Standard
}
</pre>

<h1><a name="JobResource">The Job Resource</a></h1>
The Job resource defines a Job (Backup, Restore, ...) that Bacula must
perform.  Each Job resource definition contains the names
of the Clients and their FileSets to backup or restore, 
the Schedule for the Job, where the data are to be stored, 
and what media Pool can be used.  In effect, each Job resource
must specify What, Where, How, and When or FileSet, Storage, 
Backup/Restore/Level, and Schedule respectively.
<p>Only a single type (<b>Backup</b>, <b>Restore</b>, ...) can be
specified for any job. If you want to backup multiple FileSets on
the same Client or multiple Clients, you must define a Job for
each one. 

<dl>
<dt>Job</dt><dd>Start of the Job records. At least one Job
    resource is required. </dd>

<dt>Name = &lt;name&gt;</dt><dd>The Job name.  This name can be specified
    on the <b>Run</b> command in the console program to start a job. If the
    name contains spaces, it must be specified between quotes. It is
    generally a good idea to give your job the same name as the Client
    that it will backup. This permits easy identification of jobs.
    <p>When the job actually runs, the unique Job Name will consist     
    of the name you specify here followed by the date and time the
    job was scheduled for execution. This record is required. </dd>

<dt>Type = &lt;job-type&gt;</dt><dd>The <b>Type</b> record specifies
    the Job type, which may be one of the following: <b>Backup</b>,
    <b>Restore</b>, <b>Verify</b>, or <b>Admin</b>. This record
    is required. 
    <dl>
      <dt>Backup</dt><dd>Run a backup Job. Normally you will 
          have at least one Backup job for each client you want
          to save. Normally, unless you turn off cataloging, 
          most all the important statistics and data concerning
          files backed up will be placed in the catalog. </dd>
      <dt>Restore</dt><dd>Run a restore Job. Normally, you will 
          specify only one Restore job which acts as a sort
          of prototype that you will modify using the console 
          program in order to perform restores. Although certain
          basic information from a Restore job is saved in the
          catalog, it is very minimal compared to the information
          stored for a Backup job -- for example, no File records
          are generated since no Files are saved.</dd>
      <dt>Verify</dt><dd>Run a verify Job. This is a very useful 
          feature that allows you to use <b>Bacula's</b> database
          to ensure that critical system files are not modified
          by hackers. If the Verify job is level InitCatalog
          a record for each File will be placed in the catalog.
          However, for a simple level Catalog Verify job, only
          summary information on the job goes into the catalog. </dd>
      <dt>Admin</dt><dd>Run a admin Job. An <b>Admin</b> job can
         be used to periodically run catalog pruning, if you
         do not want to do it at the end of each <b>Backup</b>
         Job. Although an Admin job is recorded in the
         catalog, very little data is saved. </dd>
       </dl>
      

<dt>Level = &lt;job-level&gt;</dt><dd>The Level record specifies
    the default Job level to be run. The Level is normally  overridden
    by a different value that is specified in the <b>Schedule</b>
    resource. This record is not required, but must be specified either
    by a <b>Level</b> record or as a override specified in the
    <b>Schedule</b> resource.
    <p>For a <b>Backup</b> Job, the Level may be one of the
    following:
   <dl>
    <dt>Full</dt><dd>is all files in the FileSet whether or not they
        have changed.</dd>
    <dt>Incremental</dt><dd>is all files that have changed since the
        last successful backup of the specified FileSet.</dd>
    <dt>Differential</dt><dd>is all files that have changed since the
        last successful Full backup of the specified FileSet.</dd>

<!-- begin comment 
    <dt>*Since date</dt><dd>is all files that have changed since the
         date specified.</dd>

   -- end comment -->

   </dl>

   <dl>
     <p>For a <b>Restore</b> Job, no level need be specified.
   </dl>

   <dl>
    <p>For a <b>Verify</b> Job, the Level may be one of the 
    following:
    <dt>InitCatalog</dt><dd>does a scan of the specified <b>FileSet</b>
        and stores the file attributes in the Catalog database.  At
        first glance, you might ask why you would want to do this.  It
        turns out to be a very simple and easy way to have a
        <b>Tripwire</b> like feature using <b>Bacula</b>.  In other
        words, it allows you to save the state of a set of files defined
        by the <b>FileSet</b> and later check to see if those files have
        been modified or deleted and if any new files have been added.
        This can be used to detect system intrusion.  Typically you
        would specify a <b>FileSet</b> that contains the set of system
        files that should not change (e.g.  /sbin, /boot, /lib, /bin,
        ...).  Normally, you run this command one time when your system
        is first setup, and then once again after each modification
        (upgrade) to your system.  Thereafter, you use a <b>Verify</b>
        <b>level = Catalog</b> to compare the results of your
        <b>InitCatalog</b> with the current state of the files.  <dd>

    <dt>Catalog</dt><dd>Compares the current state of the files against
        the value previously saved during an <b>InitCatalog</b>.  Any
        discrepancies are reported.  The items reported are determined
        by the <b>verify</b> options specified on the <b>Include</b>
        directive in the specified <b>FileSet</b> (see the
        <b>FileSet</b> resource below for more details).  Typically this
        command will be run once a day (or night) to check for any
        changes to your system files.           
        <p>Please note! If you run two Verify Catalog jobs on
        the same client at the same time, the results will   
        certainly be incorrect. This is because the Verify Catalog 
        modifies the Catalog database while running.
       </dd>

    <dt>VolumeToCatalog</dt><dd>This level causes Bacula to read 
        the file attribute data written to the Volume from the last Job.
        The file attribute data are compared to the values saved in the
        Catalog database and any differences are reported.  This is
        similar to the <b>Catalog</b> level except that instead of
        comparing the disk file attributes to the catalog database, the
        attribute data written to the Volume is read and compared to the
        catalog database.  Although the attribute data including the
        signatures (MD5 or SHA1) are compare the actual file data is not
        compared (it is not in the catalog).  <p>Please note!  If you
        run two Verify VolumeToCatalog jobs on the same client at the
        same time, the results will certainly be incorrect.  This is
        because the Verify VolumeToCatalog modifies the Catalog database
        while running.  </dd>

<!-- begin comment
    <dt>*Data</dt><dd>This level causes Bacula to rescan the last job run
        and to verify that the data written to the Volume(s) can be
        read and that it is the same as the contents of the disk.</dd>
     end comment -->

  </dl>

<dt>Bootstrap = &lt;bootstrap-file&gt;</dt><dd>The Bootstrap
    record specifies a bootstrap file that, if provided, will
    be used during <b>Restore</b> Jobs and is ignored in other
    Job types. The <b>bootstrap</b>
    file contains the list of tapes to be used in a restore
    Job as well as which files are to be restored. Specification
    of this record is optional, and
    if specified, it is used only for a restore job. In addition, 
    when running a Restore job from the console console, this value can
    be changed. 
    <p>
    If you use the <b>Restore</b> command in the Console program,
    to start a restore job, the <b>bootstrap</b> 
    file will be created automatically from the files you
    select to be restored.
    <p>
    For additional details of the <b>bootstrap</b> file, please see    
    <a href="bootstrap.html">Restoring Files with the Bootstrap File</a>
    chapter of this manual.

<dt><a name="writebootstrap"></a> Write Bootstrap =
    &lt;bootstrap-file-specification&gt;</dt><dd>The
    <b>writebootstrap</b> record specifies a file name where
    <b>Bacula</b> will write a <b>bootstrap</b> file for each Backup job
    run.  Thus this record applies only to Backup Jobs.  If the Backup
    job is a Full save, <b>Bacula</b> will erase any current contents of
    the specified file before writing the bootstrap records.  If the Job
    is an Incremental save, <b>Bacula</b> will append the current
    bootstrap record to the end of the file.  <p>Using this feature,
    permits you to constantly have a bootstrap file that can recover the
    current state of your system.  Normally, the file specified should
    be a mounted drive on another machine, so that if your hard disk is
    lost, you will immediately have a bootstrap record available.  <p>If
    the <b>bootstrap-file-specification</b> begins with a vertical bar
    (|), Bacula will use the specification as the name of a program to
    which it will pipe the bootstrap record.  It could for example be a
    shell script that emails you the bootstrap record.  <p>For more
    details on using this file, please see the chapter entitled <a
    href="bootstrap.html">The Bootstrap File</a> of this manual.  </dd>
    

<dt>Client = &lt;client-resource-name&gt;</dt><dd>The Client record
    specifies the Client (File daemon) that will be used in the
    current Job. Only a single Client may be specified in any one Job.
    The Client runs on the machine to be backed up,
    and sends the requested files to the Storage daemon for backup,
    or receives them when restoring. For additional details, see the 
    <a href="dirdconf.html#ClientResource">Client Resource
    section</a> of this chapter. This record is required. </dd>

<dt>FileSet = &lt;FileSet-resource-name&gt;</dt><dd>The FileSet record
    specifies the FileSet that will be used in the
    current Job. The FileSet specifies which directories (or files)
    are to be backed up, and what options to use (e.g. compression, ...).
    Only a single FileSet resource may be specified in any one Job.
    For additional details, see the 
    <a href="dirdconf.html#FileSetResource">FileSet Resource
    section</a> of this chapter. This record is required.</dd>

<dt>Messages = &lt;messages-resource-name&gt;</dt><dd>The Messages record
    defines what Messages resource should be used for this job, and thus
    how and where the various messages are to be delivered.  For example,
    you can direct some messages to a log file, and others can be
    sent by email.  For additional details, see the 
    <a href="messagesres.html">Messages Resource</a> Chapter of this
    manual.  This record is required.  </dd>

<dt>Pool = &lt;pool-resource-name&gt;</dt><dd>The Pool record defines
    the pool of Volumes where your data can be backed up. Many Bacula
    installations will use only the <b>Default</b> pool. However, if
    you want to specify a different set of Volumes for different
    Clients or different Jobs, you will probably want to use Pools.
    For additional details, see the <a href="dirdconf.html#PoolResource">Pool 
    Resource section</a> of this
    chapter.  This resource is required.  </dd>

<dt>Schedule = &lt;schedule-name&gt;</dt><dd>The Schedule record defines
   what schedule is to be used for the Job.  The schedule determines
   when the Job will be automatically started and what Job level
   (i.e. Full, Incremental, ...) is to be run.
   For additional details, see the <a href="dirdconf.html#ScheduleResource">Schedule Resource
   Chapter</a> of this manual. 
   If a Schedule resource is
   specified, the job will be run according to the schedule specified.
   If no Schedule resource is specified for the Job, the job must
   be manually started using the Console program. Although you may
   specify only a single Schedule resource for any one job, the Schedule
   resource may contain multiple <b>run</b> records, which allow you
   to run the Job at many different times, and each <b>run</b> record
   permits overriding the default Job Level Pool, Storage,
   and Messages
   resources. This gives considerable flexibility in what can be done
   with a single Job. </dd>

<dt>Storage = &lt;storage-resource-name&gt;</dt><dd>The Storage record
    defines the name of the storage services where you want to backup
    the FileSet data.  For additional details, see the <a
    href="dirdconf.html#StorageResource">Storage Resource Chapter</a> of this manual.
    This record is required.
    </dd>

<dt>*Max Run Time = &lt;seconds&gt;</dt><dd>The seconds specify the
    maximum runtime permitted for this Job. If the runtime exceeds
    this value, the job will be canceled. The default is 0 which
    indicates no maximum time limit. (NOT YET IMPLEMENTED).
    </dd>

<dt>Max Start Delay = &lt;seconds&gt;</dt><dd>The seconds specify the
    maximum delay between the scheduled time and the actual start
    time for the Job. For example, a job can be scheduled to run
    at 1:00am, but because other jobs are running, it may wait
    to run. If the delay is set to 3600 (one hour) and the job
    has not begun to run by 2:00am, the job will be canceled.
    This can be useful, for example, to prevent jobs from running
    during day time hours. The default is 0 which indicates
    no limit. </dd>

<dt>Prune Jobs = &lt;yes/no&gt;</dt><dd>Normally, pruning of Jobs
    from the Catalog is specified on a Client by Client basis in the
    Client resource with the <b>AutoPrune</b> record.  If this
    record is specified (not normally) and the value is <b>yes</b>, it
    will override the value specified in the Client resource.
    The default is <b>no</b>. </dd>

<dt>Prune Files = &lt;yes/no&gt;</dt><dd>Normally, pruning of Files
    from the Catalog is specified on a Client by Client basis in the
    Client resource with the <b>AutoPrune</b> record.  If this
    record is specified (not normally) and the value is <b>yes</b>, it
    will override the value specified in the Client resource.
    The default is <b>no</b>. </dd>

<dt>Prune Volumes = &lt;yes/no&gt;</dt><dd>Normally, pruning of Volumes
    from the Catalog is specified on a Client by Client basis in the
    Client resource with the <b>AutoPrune</b> record.  If this
    record is specified (not normally) and the value is <b>yes</b>, it
    will override the value specified in the Client resource.
    The default is <b>no</b>. </dd>

<dt>Run Before Job = &lt;command&gt;</dt><dd>The specified <b>command</b>
   is run as an external program prior to running the current Job. 
   This record is not required. The
   command string must be a valid program name or name of a shell script.
   If the exit code of the program run is non-zero, the current
   Bacula job will be canceled. 
   <p>
   Before submitting the specified command to the operating system,
   <b>Bacula</b> performs character substitution of the following
   characters:
   <pre>
    %% = %
    %c = Client's name
    %d = Director's name
    %i = JobId
    %e = Job Exit
    %j = Job
    %l = Job Level
    %n = Job name
    %t = Job type
    </pre>
    As of version 1.30, <b>Bacula</b> checks the exit status of the RunBefore
    program. If it is non-zero, the job will be error terminated.
    Lutz Kittler has pointed out that this can be a simple way to modify 
    your schedules during a holiday. For example, suppose that you normally
    do Full backups on Fridays, but Thursday and Friday are holidays. To avoid
    having to change tapes between Thursday and Friday when no one is in the
    office, you can create a RunBeforeJob that returns a non-zero status on
    Thursday and zero on all other days. That way, the Thursday job will not
    run, and on Friday the tape you insert on Wednesday before leaving will
    be used.
   <p><p></dd>

<dt>Run After Job = &lt;command&gt;</dt><dd>The specified <b>command</b>
   is run as an external program after the current job terminates. 
   This record is not required. The
   command string must be a valid program name or name of a shell script.
   If the exit code of the program run is non-zero, the current
   Bacula job will terminate in error.
   Before submitting the specified command to the operating system,
   <b>Bacula</b> performs character substitution as described above   
   for the <b>Run Before Job</b> record. 
   <p>An example of the use of this command is given in the 
   <a href="tips.html#JobNotification">Tips Chapter</a> of this manual.
   As of version 1.30, <b>Bacula</b> checks the exit status of the RunAfter
   program. If it is non-zero, the job will be terminated in error.   
   <p><p></dd>

<dt>Spool Attributes = &lt;yes/no&gt;</dt><dd>The default is set to 
   <b>no</b>, which means that the File attributes are sent by the
   Storage daemon to the Director as they are stored on tape. However,
   if you want to avoid the possibility that database updates will
   slow down writing to the tape, you may want to set the value to
   <b>yes</b>, in which case the Storage daemon will buffer the
   File attributes and Storage coordinates to a temporary file
   in the Working Directory, then when writing the Job data to the tape is 
   completed, the attributes and storage coordinates will be
   sent to the Director. The default is <b>no</b>.</dd>

<dt>Where = &lt;directory&gt;</dt><dd>This record applies only
   to a Restore job and specifies a prefix to the directory name
   of all files being restored. This permits files to be restored
   in a different location from which they were saved. If <b>Where</b>
   is not specified or is set to backslash (<b>/</b>), the files
   will be restored to their original location.  By default, we
   have set <b>Where</b> in the example configuration files to be
   <b>/tmp/bacula-restores</b>. This is to prevent accidental overwriting
   of your files.
   
<dt>Prefixlinks=&lt;yes/no&gt;</dt><dd>If a <b>Where</b> path prefix is 
    specified for a recovery job, apply it to absolute links as
    well. The default is <b>No</b>. When set to <b>Yes</b> during
    restoration of files to an alternate directory, any absolute soft links
    will also be modified to point to the new alternate directory.
    Normally this is what is desired -- i.e. everything is self 
    consistent. However, if you wish to later move the files to
    their original locations, all files linked with absolute names
    will be broken. Although implemented in the Director, this
    status is not yet passed to the File daemon (for compatibility
    reasons). It will be fully enabled in version 1.31.</dd>

<dt>Maximum Concurrent Jobs = &lt;number&gt;</dt><dd>where &lt;number&gt;
   is the maximum number of Jobs from the current resource that
   can run concurrently. Note, this record limits only Jobs
   with the same name as the resource in which it appears. Any
   other restrictions on the maximum concurrent jobs such as in
   the Director, Client, or Storage resources will also apply in addition to
   the limit specified here. The
   default is set to 1, but you may set it to a larger number. 
   We strongly recommend that you read the WARNING documented under
   <a href="dirdconf.html#DirMaxConJobs">
   Maximum Concurrent Jobs</a> in the Director's resource.
   </dd>

</dl>

<p>
The following is an example of a valid Job resource definition:
<pre>
Job {
  Name = "Minou"
  Type = Backup
  Level = Incremental                 # default
  Client = Minou 
  FileSet="Minou Full Set"
  Storage = DLTDrive
  Pool = Default
  Schedule = "MinouWeeklyCycle"
  Messages = Standard
}
</pre>

<h1><a name="ScheduleResource"></a>The Schedule Resource</h1>
The Schedule resource provides a means of automatically scheduling
a Job as well as the ability to override the default Level, Pool,
Storage and Messages resources.
In general, you specify an action to be taken and when.

<dl>
<dt>Schedule</dt><dd>Start of the Schedule records. No <b>Schedule</b>
    resource is required, but you will need at least one if you want
    Jobs to be automatically started.</dd>
<dt>Name = &lt;name&gt;</dt><dd>The name of the schedule being defined.
    The name record is required.</dd>
<dt>Run = &lt;Job-overrides&gt; &lt;Date-time-specification&gt;
    </dt><dd>The Run record defines when a Job is to be run,
    and what overrides if any to apply. You may specify multiple
    <b>run</b> records within a <b>Schedule</b> resource. If you
    do, they will all be applied (i.e. multiple schedules). If you
    have two <b>run</b> records that start at the same time, two
    Jobs will start at the same time (well, within one second of
    time difference).
    
    <p>The <b>Job-overrides</b> permit overriding the <b>Level</b>, the
    <b>Storage</b>, the <b>Messages</b>, and the <b>Pool</b> specifications
    provided in the Job resource. By the use of these overrides, you 
    may customize a particular Job. For example, you may specify a
    <b>Messages</b> override for your <b>Incremental</b> backups that
    outputs messages to a log file, but for your weekly or monthly
    <b>Full</b> backups, you may send the output by email by using
    a different <b>Messages</b> override.
    <p>The <b>Job-overrides</b> are specified as:
    <b>keyword=value</b> where the keyword is <b>Level</b>, <b>Storage</b>,
    <b>Messages</b>, or <b>Pool</b>, and the <b>value</b> is as defined
    on the respective record formats for the Job resource. You may specify
    multiple <b>Job-overrides</b> on one <b>Run</b> record by separating them
    with one or more spaces or by separating them with a trailing comma.

    For example:
    <dl>
    <dt>Level=Full</dt><dd>is all files in the FileSet whether or not
        they have changed.

    <dt>Level=Incremental</dt><dd>is all files that have changed since
        the last backup.</dd>
    <dt>Pool=Weekly</dt><dd>specifies to use the Pool named <b>Weekly</b>.
    <dt>Storage=DLT_Drive</dt><dd>specifies to use <b>DLT_Drive</b> for
        the storage device.</dd>
    <dt>Messages=Verbose</dt><dd>specifies to use the <b>Verbose</b>
        message resource for the Job.</dd>
    </dl>

    <p>The <b>Date-time-specification</b> allows you to specify when the
    Job is to be run. Any specification given is assumed to be repetitive in
    nature. For example, <b>daily</b> means every day of every month in 
    every year.  
    <p>Basically, you must supply a <b>month</b>, <b>day</b>, <b>hour</b>, and
    <b>minute</b> the Job is to be run. Of these four items to be specified,
    <b>day</b> is special in that you may either specify a day of the month
    such as 1, 2, ... 31, or you may specify a day of the week such
    as Monday, Tuesday, ... Sunday. Finally, you may also specify a
    week qualifier to restrict the schedule to the first, second, third,
    fourth, or fifth week of the month.
    <p>The Job will be run on either day that
    matches the current day (day of the week, or day of the month).
    <p>The default is that every hour of every day of every week of every
    month is set.  As you specify the parts of the time, the default for
    that part of the time is cleared and the new value set.  However,
    the other defaults are set until their corresponding part is set.
    For example, if you specify only a day of the week, such as <b>Tuesday</b>
    the Job will be run every hour of every Tuesday of every Month. That
    is the <b>month</b> and <b>hour</b> remain set to the defaults of
    every month and all hours.

   <p>The following special keywords specify multiple parts of the
   time (e.g. <b>day</b> and <b>hour</b>), and in specifying them
   none of the other defaults are cleared:
   <pre>
    Keyword       Meaning
    ===========   ================
    Hourly        Every hour of every day of every month
    Weekly        Every Sunday of the week of every month
    Daily         Every day of every month
    Monthly       Every first day of every month
    </pre>

    <p>All the other keywords show below specify only a single part of the time,
    and specifying them will clear all the defaults, which means that
    you must then specify all parts of the time:

    

    <p>The date/time to run the Job can be specified in the following way
     in pseudo-BNF: <dd>
<pre>
&lt;void-keyword&gt;    = on
&lt;at-keyword&gt;      = at
&lt;week-keyword&gt;    = 1st | 2nd | 3rd | 4th | 5th | first |
                    second | third | forth | fifth
&lt;wday-keyword&gt;    = sun | mon | tue | wed | thu | fri | sat |
                    sunday | monday | tuesday | wednesday | 
                    thursday | friday
&lt;month-keyword&gt;   = jan | feb | mar | apr | may | jun | jul |
                    aug | sep | oct | nov | dec | january |
                    february | ... | december
&lt;daily-keyword&gt;   = daily
&lt;weekly-keyword&gt;  = weekly
&lt;monthly-keyword&gt; = monthly
&lt;hourly-keyword&gt;  = hourly
&lt;digit&gt;           = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
&lt;number&gt;          = &lt;digit&gt; | &lt;digit&gt;&lt;number&gt;
&lt;12hour&gt;          = 0 | 1 | 2 | ... 12
&lt;hour&gt;            = 0 | 1 | 2 | ... 23
&lt;minute&gt;          = 0 | 1 | 2 | ... 59
&lt;day&gt;             = 1 | 2 | ... 31
&lt;time&gt;            = &lt;hour&gt;:&lt;minute&gt; | 
                    &lt;12hour&gt;:&lt;minute&gt;am | 
                    &lt;12hour&gt;:&lt;minute&gt;pm
&lt;time-spec&gt;       = &lt;at-keyword&gt; &lt;time&gt; | 
                    &lt;hourly-keyword&gt;
&lt;date-keyword&gt;    = &lt;void-keyword&gt;  &lt;weekly-keyword&gt; 
&lt;day-range&gt;       = &lt;day&gt;-&lt;day&gt;
&lt;month-range&gt;     = &lt;month-keyword&gt;-&lt;month-keyword&gt;
&lt;wday-range&gt;      = &lt;wday-keyword&gt;-&lt;wday-keyword&gt;
&lt;range&gt;           = &lt;day-range&gt; | &lt;month-range&gt; | 
                          &lt;wday-range&gt;
&lt;date&gt;            = &lt;date-keyword&gt; | &lt;day&gt; | &lt;range&gt;                            
&lt;date-spec&gt;       = &lt;date&gt; | &lt;date-spec&gt;
&lt;day-spec&gt;        = &lt;day&gt; | &lt;wday-keyword&gt; | 
                    &lt;day-range&gt; | &lt;wday-range&gt; |
                    &lt;daily-keyword&gt;
&lt;day-spec&gt;        = &lt;day&gt; | &lt;wday-keyword&gt; |
                    &lt;week-keyword&gt; &lt;wday-keyword&gt;
&lt;month-spec&gt;      = &lt;month-keyword&gt; | &lt;month-range&gt; | 
                    &lt;monthly-keyword&gt;
&lt;date-time-spec&gt;  = &lt;month-spec&gt; &lt;day-spec&gt; &lt;time-spec&gt;

</pre></dd>
   </dl>
</dl>

An example schedule resource that is named <b>WeeklyCycle</b> and runs a
job with level full each Sunday at 1:05am and an incremental job Monday
through Saturday at 1:05am is:
<pre>
Schedule {
  Name = "WeeklyCycle"
  Run = Level=Full sun at 1:05
  Run = Level=Incremental mon-sat at 1:05
}
</pre>
An example of a possible mothly cycle is as follows:
<pre>
Schedule {
  Name = "MonthlyCycle"
  Run = Level=Full 1st sun at 1:05
  Run = Level=Differential 2nd-5th sun at 1:05
  Run = Level=Incremental mon-sat at 1:05
}
</pre>


<h1><a name="FileSetResource">The FileSet Resource</a></h1>
The FileSet resource defines what files are to be included in a backup
job. At least one <b>FileSet</b> resource is required.
It consists of a list of files or directories to be included, a
list of files or directories to be excluded and the various backup
options such as compression, encryption, and signatures that are to be
applied to each file.
<dl>
<dt>FileSet</dt><dd>Start of the FileSet records. At least one <b>FileSet</b>
    resource must be defined.</dd>
<dt>Name = &lt;name&gt;</dt><dd>The name of the FileSet resource.
    This record is required. </dd>
<dt>Include = &lt;processing-options&gt; <br>&nbsp;&nbsp; { &lt;file-list&gt; } <br></dt><dd></dd>
<p> 
The Include resource specifies the list of files and/or directories to
be included in the backup job.  There can be any number of <b>Include</b>
<b>file-list</b> specifications within the FileSet, each having its own
set of <b>processing-options</b>.  Normally, the <b>file-list</b>
consists of one file or directory name per line.  Directory names should
be specified without a trailing slash.  Wild-card (or glob matching)
can be specified. As a consequence, any asterisk (*), question mark (?),
or left-bracket ([) must be preceded by a slash (\\) if you want it
to represent the literal character. 
<p>You should <b>always</b> specify
a full path for every directory and file that you list in the FileSet.
In addition, on Windows machines, you should <b>always</b> prefix the
directory or filename with the drive specification (e.g.  <b>c:/xxx</b>).
<p>
Bacula's default for processing directories is to recursively descend
in the directory saving all files and subdirectories. Bacula will not
by default cross file systems (or mount points in Unix parlance). This
means that if you specify the root partition (e.g. <b>/</b>), Bacula will
save only the root partition and not any of the other mounted 
file systems. Similarly on Windows systems, you must explicitly 
specify each of the drives you want saved (e.g. <b>c:/</b>  and <b>d:/</b> ...).
The <b>df</b> command on Unix systems will show you which 
mount points you must specify to save everything. See below for
an example.
<p>
The <b>&lt;processing-options&gt;</b> is
optional.  If specified, it is a list of <b>keyword=value</b>
options to be applied to the file-list.  Multiple options may be
specified by separating them with spaces. 
These options are used to
modify the default processing behavior of the files included.  Since
there can be multiple <b>Include</b> sets, this permits effectively
specifying the desired options (compression, encryption, ...) on a
file by file basis. The options may be one of the following:
<dl>
<dt>compression=GZIP</dt><dd>All files saved will be software
    compressed using the GNU ZIP compression format. The
    compression is done on a file by file basis by the File daemon.
    If there is a problem reading the tape in a 
    single record of a file, it will at most affect that file and none
    of the other files on the tape. Normally this option is <b>not</b> needed
    if you have a modern tape drive as the drive will do its own
    compression. However, compression is very important if you are writing
    your Volumes to a file, and it can also be helpful if you have a
    fast computer but a slow network.
    <p>
    Specifying <b>GZIP</b> uses the default compression level six  
    (i.e. <b>GZIP</b> is identical to <b>GZIP6</b>). If you
    want a different compression level (1 through 9), you can specify
    it by appending the level number with no intervening spaces
    to <b>GZIP</b>. Thus <b>compression=GZIP1</b> would give  minimum
    compression but the fastest algorithm, and <b>compression=GZIP9</b>
    would give the highest level of compression, but requires more
    computation. According to the GZIP documentation, compression levels
    greater than 6 generally give very little extra compression but are
    rather CPU intensive.


<dt>signature=MD5</dt><dd>An MD5 signature will be computed for all
      files saved. Adding this option generates about 5% extra overhead
      for each file saved. We strongly recommend that this option
      be specified as a default for all files.</dd>

<dt>signature=SHA1</dt><dd>An SHA1 signature will be computed for all
      files saved. Adding this option generates about extra overhead
      for each file saved. The SHA1 algorithm is purported to be some
      what slower than the MD5 algorithm, but at the same time is
      significantly better from a cryptographic point of view (i.e.
      much fewer collisions, much lower probability of being hacked.)
      We strongly recommend that either this option
      or MD5 be specified as a default for all files. Note, only
      one of the two options MD5 or SHA1 can be computed for any
      file. </dd>

<dt>*encryption=&lt;algorithm&gt;</dt><dd>All files saved will be
    encrypted using one of the following algorithms (NOT YET IMPLEMENTED):
        <dl>
           <dt>*Blowfish</dt>
           <dt>*3DES</dt>
        </dl> 

<dt>verify=&lt;options&gt;</dt><dd>The options letters specified are used
   when running a <b>Verify Level=Catalog</b> job, and may be any
   combination of the following:
   <dl>
           <dt>i</dt><dd>compare the inodes</dd>
           <dt>p</dt><dd>compare the permission bits</dd>
           <dt>n</dt><dd>compare the number of links</dd>
           <dt>u</dt><dd>compare the user id</dd>
           <dt>g</dt><dd>compare the group id</dd>
           <dt>s</dt><dd>compare the size</dd>
           <dt>a</dt><dd>compare the access time</dd>
           <dt>m</dt><dd>compare the modification time (st_mtime)</dd>
           <dt>c</dt><dd>compare the change time (st_ctime)</dd>
           <dt>s</dt><dd>report file size decreases</dd>
           <dt>5</dt><dd>compare the MD5 signature</dd>
           <dt>1</dt><dd>compare the SHA1 signature</dd>
   </dl> 
   <p>
   <dd>A useful set of general options on the <b>Level=Catalog</b>
       verify is <b>pins5</b> i.e. compare permission bits, inodes, number
       of links, size, and MD5 changes.</dd>
<dt>onefs=yes/no</dt><dd>If set to <b>yes</b> (the default), <b>Bacula</b>
    will remain on a single file system. That is it will not backup
    file systems that are mounted on a subdirectory.
    In this case, you must explicitly list each file system you want saved.
    If you set this option to <b>no</b>, <b>Bacula</b> will backup
    all mounted file systems (i.e. traverse mount points) that
    are found within the <b>FileSet</b>. Thus if
    you have NFS or Samba file systems mounted on a directory included
    in your FileSet, they will also be backed up. Normally, it is
    preferable to set <b>onefs=yes</b> and to explicitly name
    each file system you want backed up.
    See the example below for more details. </dd>
<dt>recurse=yes/no</dt><dd>If set to <b>yes</b> (the default),
    <b>Bacula</b> will recurse (or descend) into all subdirectories
    found unless the directory is explicitly excluded
    using an <b>exclude</b> definition. 
    If you set
    <b>recurse=no</b>, <b>Bacula</b> will save the subdirectory entries,
    but not descend into the subdirectories, and thus 
    will not save the contents of the subdirectories. Normally, you
    will want the default (<b>yes</b>).
    </dd>
<dt>sparse=yes/no</dt><dd>Enable special code that checks for sparse files
    such as created by ndbm. The default is <b>no</b>, so no checks
    are made for sparse files. You may specify <b>sparse=yes</b> even
    on files that are not sparse file. No harm will be done, but there
    will be a small additional overhead to check for buffers of
    all zero, and a small additional amount of space on the output
    archive will be used to save the seek address of each non-zero
    record read. 
    <p><b>Restrictions:</b> <b>Bacula</b> reads files in 32K buffers. 
    If the whole buffer is zero, it will be treated as a sparse
    block and not written to tape.  However, if any part of the buffer
    is non-zero, the whole buffer will be written to tape, possibly
    including some disk sectors (generally 4098 bytes) that are all
    zero. As a consequence, Bacula's detection of sparse blocks is in
    32K increments rather than the system block size. If anyone      
    considers this to be a real problem, please send in a request
    for change with the reason. The sparse code was first 
    implemented in version 1.27.</dd>

    
<dt>*noexec=yes/no</dt><dd>All executable files will be automatically
    excluded from being saved. The default is <b>no</b> i.e. all files
    including executable files are saved. (NOT YET IMPELEMENTED)</dd>

<dt>*nofollow=yes/no</dt><dd>Any symbolic link found will be saved, but
     the link will not be followed (default).  This is normally exactly what
     is desired because the file pointed to by the link will be
     also normally included in the save the same way the link was
     included. In some special cases, one might want to save just
     the contents of a directory and also include the contents
     of all links in that directory. This is possible by specifying
     <b>nofollow=no</b> (NOT YET IMPLEMENTED).</dd>

<dt>*nonfs=yes/no</dt><dd>Any file that resides on an NFS file system
    will not be saved. The default is <b>no</b> so that any
    NFS file system specified in the <b>include</b> list will be
    backed up. (NOT YET IMPLEMENTED)</dd>
</dl>
<p>
<b>&lt;file-list&gt;</b> is a space separated list of filenames
and/or directory names.  To include names containing spaces, enclose the
name between double-quotes.  The list may span multiple lines, in fact,
normally it is good practice to specify each filename on a separate
line.  
<p>There are a number of special cases when specifying files or
directories in a <b>file-list</b>. They are:
<ul>
  <li>Any file-list item preceded by an at-sign (@) is assumed to be a
      filename containing a list of files, which is read when
      the configuration file is parsed during Director startup.
      </li>     
  <li>Any file-list item beginning with a vertical bar (|) is 
      assumed to be a program. This program will be executed by
      Bacula at the time the Job starts (not when the Director
      reads the configuration file), and any output from that 
      program will be assumed to be a list of files or directories,
      one per line, to be included. This allows you to have a job
      that for example includes all the local partitions even if
      you change the partitioning by adding a disk.
      <p>As an example:
      <pre>
      Include = signature=SHA1 {
         "|sh -c 'df -l | grep \"^/dev/hd[ab]\" | grep -v \".*/tmp\" 
         | awk \"{print \\$6}\"'"
      }
      </pre>
      will produce a list of all the local partitions on a RedHat Linux
      system.  Note, the above line was split, but should normally
      be written on one line.
      Quoting is a real problem because you must quote for Bacula
      which consists of preceding every \ and every &quot; with a \, and
      you must also quote for the shell command.  In the end, it is probably
      easier just to execute a small file with:
      <pre>
      Include = signature=MD5 {
         "|my_partitions"
      }
      </pre>
      where my_partitions has:
      <pre>
      \#!/bin/sh
      df -l | grep "^/dev/hd[ab]" | grep -v ".*/tmp" | awk "{print \$6}"
      </pre></li>

   <li>Any file-list item preceded by a less-than sign (<) will be taken
       to be a file. This file will be read by Bacula at the time the Job
       starts, and the data will be assumed to be a list of directories
       or files, one per line, to be included. This feature allows you
       to modify the external file and change what will be saved without
       stopping and restarting Bacula as would be necessary if using
       the @ modifier noted above.</li>

   <li>If you explicitly specify a block device such as <b>/dev/hda1</b>,
       then <b>Bacula</b> (starting with version 1.28) will assume that this
       is a raw partition to be backed up. In this case, you are strongly
       urged to specify a <b>sparse=yes</b> include option, otherwise, you
       will save the whole partition rather than just the actual data that
       the partition contains. For example:
       <pre>
       Include = signature=MD5 sparse=yes {
          /dev/hd6
       }
       </pre>
       will backup the data in device /dev/hd6.
       <p>Ludovic Strappazon has pointed out that this feature can be
       used to backup a full Microsoft Windows disk. Simply boot into
       the system using a Linux Rescue disk, then load a statically
       linked Bacula as described in the <a href="rescue.html">
       Disaster Recovery Using Bacula</a> chapter of this manual. Then
       simply save the whole disk partition. In the case of a disaster, you
       can then restore the desired partion. </li>

   <li>If you explicitly specify a fifo device name (created with mkfifo),
       and you add the option <b>readfifo=yes</b> as an option, Bacula
       will read the fifo and back its data up to the Volume. For
       example:
       <pre>
       Include = signature=SHA1 readfifo=yes {
          /home/abc/fifo
       }
       </pre>
       if <b>/home/abc/fifo</b> is a fifo device, Bacula will open the
       fifo, read it, and store all data thus obtained on the Volume.
       Please note, you must have a process on the system that is 
       writing into the fifo, or Bacula will hang, and after one 
       minute of waiting, it will go on to the next file. The data
       read can be anything since Bacula treats it as a stream.
       <p>
       This feature can be an excellent way to do a &quot;hot&quot;
       backup of a very large database. You can use the <b>RunBeforeJob</b>
       to create the fifo and to start a program that dynamically reads
       your database and writes it to the fifo. Bacula will then write
       it to the Volume. 
       <p> During the restore operation, the inverse is
       true, after Bacula creates the fifo if there was any data stored
       with it (no need to explicitly list it or add any options), that
       data will be written back to the fifo. As a consequence, if
       any such fifos exist in the fileset to be restored, you must 
       ensure that there is a reader program or Bacula will block,
       and after one minute, Bacula will time out the write to the
       fifo and move on to the next file. </li>
</ul>
       

<p>The Exclude Files specifies the list of files and/or directories to
be excluded from the backup job.  The <b>&lt;file-list&gt;</b> is a
comma separated list of filenames and/or directory names.  To exclude
names containing spaces, enclose the name between double-quotes.  The
list may span multiple lines.  Any filename preceded by an at-sign (@)
is assumed to be a filename containing a list of files.
</dl>

The following is an example of a valid FileSet resource definition:
<pre>
FileSet {
  Name = "Full Set"
  Include = compression=GZIP signature=MD5 sparse=yes { 
     @/etc/backup.list
  }
  Include = {
     /root/myfile
     /usr/lib/another_file
  }
  Exclude = { *.o }
}
</pre>
Note, in the above example, all the files contained in /etc/backup.list
will be compressed with GZIP compression, an MD5 signature will be
computed on the file's contents (its data), and sparse file handling
will apply.
<p>
The two files /root/myfile and
/usr/lib/another_file will also be saved but without any options.
In addition, all files with the extension <b>.o</b> will be excluded
from the file set (i.e. from the backup).
<p>
Suppose you want to save everything except <b>/tmp</b> on your system.
Doing a <b>df</b> command, you get the following output:
<pre>
[kern@rufus k]$ df
Filesystem      1k-blocks      Used Available Use% Mounted on
/dev/hda5         5044156    439232   4348692  10% /
/dev/hda1           62193      4935     54047   9% /boot
/dev/hda9        20161172   5524660  13612372  29% /home
/dev/hda2           62217      6843     52161  12% /rescue
/dev/hda8         5044156     42548   4745376   1% /tmp
/dev/hda6         5044156   2613132   2174792  55% /usr
none               127708         0    127708   0% /dev/shm
//minimatou/c$   14099200   9895424   4203776  71% /mnt/mmatou
lmatou:/          1554264    215884   1258056  15% /mnt/matou
lmatou:/home      2478140   1589952    760072  68% /mnt/matou/home
lmatou:/usr       1981000   1199960    678628  64% /mnt/matou/usr
lpmatou:/          995116    484112    459596  52% /mnt/pmatou
lpmatou:/home    19222656   2787880  15458228  16% /mnt/pmatou/home
lpmatou:/usr      2478140   2038764    311260  87% /mnt/pmatou/usr
deuter:/          4806936     97684   4465064   3% /mnt/deuter
deuter:/home      4806904    280100   4282620   7% /mnt/deuter/home
deuter:/files    44133352  27652876  14238608  67% /mnt/deuter/files
</pre>
Now, if you specify only <b>/</b> in your Include list, <b>Bacula</b> will
only save the Filesystem <b>/dev/hda5</b>. To save all file 
systems except <b>/tmp</b> with out including any of the Samba or NFS
mounted systems, and explicitly excluding a /tmp, /proc, .journal, and
.autofsck, which you will not want to be saved and restored,
you can use the following:
<pre>
FileSet {
  Name = Everything
  Include = {
     /
     /boot
     /home
     /rescue
     /usr
  }
  Exclude = {
     /proc
     /tmp
     .journal
     .autofsck
  }
}
</pre>
<p>
Please be aware that allowing <b>Bacula</b> to traverse or change
file systems can be very dangerous. For example, with
the following:
<pre>
FileSet {
  Name = "Bad example"
  Include = onefs=no {
     /mnt/matou
  }
}
</pre>
you will be backing up an NFS mounted partition (<b>/mnt/matou</b>),
and since <b>onefs</b> is set to <b>no</b>, <b>Bacula</b> will
traverse file systems. However, if <b>/mnt/matou</b> has the
current machine's file systems mounted, as is often the case,
you will get yourself into a recursive loop and the backup will
never end.
<p>The following FileSet definition will backup a raw partition:
<pre>
FileSet {
  Name = "RawPartition"
  Include = sparse=yes {
     /dev/hda2
  }
}
</pre>
Note, in backing up and restoring a raw partition, you should ensure
that no other process including the system is writing to that partition.
As a precaution, you are strongly urged to ensure that the raw partition
is not mounted or is mounted read-only. If necessary, this can be done using the 
<b>RunBeforeJob</b> record.


<h2>Windows Considerations for FileSets</h2>
If you are entering Windows file names, the directory path may be
preceded by the drive and a colon (as in c:). However, the path
separators must be specified in Unix convention (i.e. forward 
slash (/)). If you wish to include a quote in a file name, precede
the quote with a backslash (\\).  For example you might
use the following for a Windows machine to backup the &quot;My Documents&quot;
directory:
<pre>
FileSet {
  Name = "Windows Set"
  Include = {
     "c:/My Documents"
  }
  Exclude = { *.obj *.exe }
}
</pre>

<h2>Windows NTFS Naming Considerations</h2>
NTFS filenames containing Unicode characters (i.e. &gt; 0xFF) cannot
be explicitly named at the moment. You must include such names by
naming a higher level directory or a drive letter that does
not contain Unicode characters.

<h1><a name="ClientResource">The Client Resource</a></h1>
The Client resource defines the attributes of the Clients that are served
by this Director; that is the machines that are to be backed up.
You will need one Client resource definition for each machine to
be backed up.
<dl>
   <dt>Client (or FileDaemon)</dt><dd>Start of the Client records.</dd>
   <dt>Name = &lt;name&gt;</dt><dd>The client name which will be used in the
       Job resource record or in the console run command.
       This record is required. 
       </dd>
   <dt>Address = &lt;address&gt;</dt><dd>Where the address is a host
       name, a fully qualified domain name, or a network address in
       dotted quad notation for a Bacula File server daemon.
       This record is required. </dd>
   <dt>FD Port = &lt;port-number&gt;</dt><dd>Where the port is a port
       number at which the Bacula File server daemon can be contacted.
       The default is 9102. </dd>
   <dt>Catalog = &lt;Catalog-resource-name&gt;</dt><dd>This specifies the
       name of the catalog resource to be used for this Client.
       This record is required.
       </dd>
   <dt>Password = &lt;password&gt;</dt><dd>This is the password to be
       used when establishing a connection with the File services, so
       the Client configuration file on the machine to be backed up must
       have the same password defined for this Director.  This record is
       required.  </dd>

       <a name="FileRetention"></a>
   <dt>File Retention = &lt;time-period-specification&gt;</dt>
       <dd>The
       File Retention record defines the length of time that <b>Bacula</b>
       will keep File records in the Catalog database. When this time period
       expires, and if <b>AutoPrune</b> is set to <b>yes</b> <b>Bacula</b>
       will prune (remove) File records that are older than the specified
       File Retention period. File records may actually be retained for
       a shorter period than you specify on this record if you specify
       either a shorter <b>Job Retention</b> or shorter <b>Volume Retention</b>
       period. The shortest retention period of the three takes precedence.
       <p>This period is specified in seconds, but as
       a convenience, there are a number of modifiers that permit easy
       specification in terms of minutes, hours, days, weeks, months,  
       quarters, or years.
       See the <a href="configure.html#Time">
       Configuration chapter</a> of this manual for additional details of
       modifier specification.
       <p>The default is 60 days.
       </dd>

       <a name="JobRetention"></a>
   <dt>Job Retention = &lt;time-period-specification&gt;</dt>
       <dd>The Job
       Retention record defines the length of time that <b>Bacula</b>
       will keep Job records in the Catalog database.  When this time
       period expires, and if <b>AutoPrune</b> is set to <b>yes</b>
       <b>Bacula</b> will prune (remove) Job records that are older than
       the specified File Retention period.  Note, if a Job record is
       selected for pruning, all associated File and JobMedia records
       will also be pruned regardless of the File Retention period set.
       As a consequence, you normally will set the File retention period
       to be less than the Job retention period.
       The Job retention period can actually be less than the value
       you specify here if you set the <b>Volume Retention</b> record
       in the Pool resource to a smaller duration. This is because the
       Job retention period and the Volume retention period are 
       independently applied, so the smaller of the two takes precedence.

       <p>The Job retention period is specified in seconds, but as
       a convenience, there are a number of modifiers that permit easy
       specification in terms of minutes, hours, days, weeks, months,  
       quarters, or years.
       See the <a href="configure.html#Time">
       Configuration chapter</a> of this manual for additional details of
       modifier specification.
       <p>The default is 180 days.
       </dd>
       <a name="AutoPrune"></a>
   <dt>AutoPrune = &lt;yes/no&gt;</dt><dd>
       If AutoPrune is set to
       <b>yes</b> (default), Bacula (version 1.20 or greater) will
       automatically apply the File retention period and the Job
       retention period for the Client at the end of the Job.
       If you set <b>AutoPrune = no</b>, pruning will not be done,
       and your Catalog will grow in size each time you run a Job.
       </dd>

   <dt>Maximum Concurrent Jobs = &lt;number&gt;</dt><dd>where &lt;number&gt;
       is the maximum number of Jobs with the current Client that
       can run concurrently. Note, this record limits only Jobs
       for Clients
       with the same name as the resource in which it appears. Any
       other restrictions on the maximum concurrent jobs such as in
       the Director, Job, or Storage resources will also apply in addition to
       any limit specified here. The
       default is set to 1, but you may set it to a larger number. 
       We strongly recommend that you read the WARNING documented under
       <a href="dirdconf.html#DirMaxConJobs">
       Maximum Concurrent Jobs</a> in the Director's resource.
       </dd>

   <dt>*Priority = &lt;number&gt;</dt><dd>The number specifies the
       priority of this client relative to other clients that the
       Director is processing simultaneously.  The priority can range
       from 1 to 1000.  The clients are ordered such that the smaller
       number priorities are performed first (not currently
       implemented).</dd>
</dl>
The following is an example of a valid Client resource definition:
<pre>
Client {
  Name = Minimatou
  Address = minimatou
  Catalog = MySQL
  Password = very_good
}
</pre>


<h1><a name="StorageResource">The Storage Resource</a></h1>
The Storage resource defines which Storage daemons are available for use
by the Director.
<dl>
<dt>Storage</dt><dd>Start of the Storage records. At least one
  storage resource must be specified.</dd>

<dt>Name = &lt;name&gt;</dt><dd>The name of the storage resource.  This
  name appears on the Storage record specified in the Job record and
  is required. </dd>

<dt>Address = &lt;address&gt;</dt><dd>Where the address is a host name,
  a <b>fully qualified domain name</b>, or a <b>IP address</b>. Please note
  that the &lt;address&gt; as specified here will be transmitted to
  the File daemon who will then use it to contact the Storage daemon. Hence,
  it is <b>not</b>, a good idea to use <b>localhost</b> as the
  name but rather a fully qualified machine name or an IP address.
  This record is required. </dd>

<dt>SD Port = &lt;port&gt;</dt><dd>Where port is the port to use to
   contact the storage daemon for information and to start jobs.
   This same port number must appear in the Storage resource of the
   Storage daemon's configuration file. The default is 9103. </dd>

<dt>Password = &lt;password&gt;</dt><dd>This is the password to be used
  when establishing a connection with the Storage services. This
  same password also must appear in the Director resource of the Storage
  daemon's configuration file. This record is required.</dd>

<dt>Device = &lt;device-name&gt;</dt><dd>This record specifies the name
  of the device to be used to for the storage.  This name is not the
  physical device name, but the logical device name as defined on the
  <b>Name</b> record contained in the <b>Device</b> resource
  definition of the <b>Storage daemon</b> configuration file.  
  You can specify any name you would like (even the device name if
  you prefer) up to a maximum of 127 characters in length.
  The physical device name associated with this device is specified in
  the <b>Storage daemon</b> configuration file (as <b>Archive
  Device</b>). This record is required.</dd>

<dt>Media Type = &lt;MediaType&gt;</dt><dd>This record specifies the
  Media Type to be used to store the data.  This is an arbitrary
  string of characters up to 127 maximum that you define. It can
  be anything you want. However, it is best to
  make it descriptive of the storage media (e.g.  File, DAT, &quot;HP
  DLT8000&quot;, 8mm, ...).  The <b>MediaType</b> specified here, <b>must</b>
  correspond to the <b>Media Type</b> specified in the <b> Device</b>
  resource of the <b>Storage daemon</b> configuration file.
  This record is required, and it is used by the Director and the
  Storage daemon to ensure that a Volume automatically selected from
  the Pool corresponds to the physical device. If a Storage daemon
  handles multiple devices (e.g. will write to various file Volumes
  on different partitions), this record allows you to specify exactly
  which device.
  <p>
  As mentioned above, the value specified in the Director's Storage
  resource must agree with the value specified in the Device resource in
  the <b>Storage daemon's</b> configuration file. It is also an
  additional check so
  that you don't try to write data for a DLT onto an 8mm device.</dd>

<a name="Autochanger"></a>
<dt>Autochanger = &lt;yes/no&gt;</dt>
   <dd>If you specify <b>yes</b>
   for this command (the default is <b>no</b>), when you use the <b>label</b>
   command or the <b>add</b> command to create a new Volume, <b>Bacula</b>
   will also request the Autochanger Slot number. This simplifies 
   creating database entries for Volumes in an autochanger. If you forget
   to specify the Slot, the autochanger will not be used. However, you
   may modify the Slot associated with a Volume at any time
   by using the <b>update volume</b> command in the console program.
   You may include this record whether the Storage device is
   really an autochanger or not. It will do no harm, but the Slot 
   information will simply be ignored by the Storage daemon if the
   device is not really an autochanger. 
   The default is <b>no</b>. 
   <p>
   For the autochanger to be
   used, you must also specify <b>Autochanger = yes</b> in the
   <a href="storedconf.html#Autochanger">Device Resource</a>
   in the Storage daemon's configuration file.
   See the <a href="autochangers.html">
   Using Autochangers</a> manual of this chapter for the details of
   using autochangers. </dd>

<dt>Maximum Concurrent Jobs = &lt;number&gt;</dt><dd>where &lt;number&gt;
    is the maximum number of Jobs with the current Storage resource that
    can run concurrently. Note, this record limits only Jobs
    for Jobs using this Storage daemon. Any
    other restrictions on the maximum concurrent jobs such as in
    the Director, Job, or Client resources will also apply in addition to
    any limit specified here. The
    default is set to 1, but you may set it to a larger number. 
    We strongly recommend that you read the WARNING documented under
    <a href="dirdconf.html#DirMaxConJobs">
    Maximum Concurrent Jobs</a> in the Director's resource.
    <p>
    While it is possible to set the Director's, Job's, or Client's 
    maximum concurrent jobs greater than one, you should take great
    care in setting the Storage daemon's greater than one. By keeping
    this record set to one, you will avoid having two jobs simultaneously
    write to the same Volume. Although this is supported, it is not
    currently recommended.

    </dd>

</dl>
The following is an example of a valid Storage resource definition:
<pre>
\# Definition of tape storage device
Storage {
  Name = DLTDrive
  Address = lpmatou
  Password = local_storage_password   # password for Storage daemon
  Device = "HP DLT 80"                # same as Device in Storage daemon
  Media Type = DLT8000                # same as MediaType in Storage daemon
}

</pre>


<h1><a name="PoolResource"></a>The Pool Resource</h1>
The Pool resource defines the set of storage Volumes (tapes or files) to
be used by <b>Bacula</b> to write the data. 
By configuring different
Pools, you can determine which set of Volumes (media) receives the
backup data. This permits, for example, to store all full backup
data on one set of Volumes and all incremental backups on another
set of Volumes. Alternatively, you could assign a different set 
of Volumes to each machine that you backup. This is most easily done
by defining multiple Pools.
<p>Another important aspect of a Pool is that contains the default
attributes (Maximum Jobs, Retention Period, Recycle flag, ...) that
will be given to a Volume when it is created. This avoids the need
for you to answer a large number of questions when labeling a
new Volume.  Each of these attributes
can later be changed on a Volume by Volume basis using the <b>update</b>
command in the console program. Note that you must explicitly
specify which Pool Bacula is to use with each Job. Bacula will
not automatically search for the correct Pool.

<p>Most often in Bacula installations all backups for all machines 
(Clients) go to a single set of Volumes.  In this case, you will
probably only use the <b>Default</b> Pool.

<p>To use a Pool, there are three distinct steps.
First the Pool must be defined in the Director's
configuration file. Then the Pool must be written
to the Catalog database. This is done
automatically by the Director each time that it
starts, or alternatively can be done
using the <b>create</b> command in the console program.
However, if you change the Pool definition in the Director's
configuration file and restart Bacula, then you will need
to use the <b>update pool</b> console command to refresh
the database image. It is this database image rather than
the Director's resource image that is used for the
default Volume attributes.

<p>Next the physical media must be labeled.
The labeling can either be done with the <b>label</b>
command in the <b>console</b> program or using the
<b>btape</b> program. The preferred method is to
use the <b>label</b> command in the <b>console</b>
program. 

<p>Finally, you must add Volumes names (and their attributes) to the
Pool.  For Volumes to be used by <b>Bacula</b> they must be of the same
<b>Media Type</b> as the archive device specified for the job (i.e.  if
you are going to back up to a DLT device, the Pool must have DLT volumes
defined since 8mm volumes cannot be mounted on a DLT drive).  The
<b>Media Type</b> has particular importance if you are
backing up to files. When running a Job, you must explicitly specify
which Pool to use. Bacula will then automatically select the
next Volume to use from the Pool, but it will ensure that the
<b>Media Type</b> of any Volume selected from the Pool is identical
to that required by the Storage resource you have specified for the
Job.

<p>If you use the <b>label</b> command in the console
program to label the Volumes, they will automatically
added to the Pool, so this last step is not normally
required. 

<p>It is also possible to add Volumes to the database
without explicitly labeling the physical volume. This is
done with the <b>add</b> console command.

<p>As previously mentioned, each time <b>Bacula</b> starts, it scans all
the Pools associated with each Catalog, and if the database record does
not already exist, it will be created from the Pool Resource definition.
(It really probably should do an <b>update pool</b> if you change the
Pool definition, but currently, you must do this manually do so
using the Console program.

<p>The Pool Resource defined in the Director's
configuration file (bacula-dir.conf) may contain the following records:
<dl>
  <dt>Pool</dt><dd>Start of the Pool records. The must
    be at least one Pool resource defined. </dd>

  <dt>Name = &lt;name&gt;</dt><dd>The name of the pool.
    For most applications, you will use the default pool
    name <b>Default</b>. This record is required.</dd>

  <dt>Number of Volumes = &lt;number&gt;</dt><dd>This record specifies
      the number of volumes (tapes or files) contained in the pool.
      Normally, it is defined and updated automatically by the 
      <b>Bacula</b> catalog handling routines. </dd>

   <a name="MaxVolumes"></a>
  <dt>Maximum Volumes = &lt;number&gt;</dt><dd>This record specifies the
      maximum number of volumes (tapes or files) contained in the pool. 
      This record is optional, if omitted or set to zero, any number
      of volumes will be permitted. In general, this record is useful
      for Autochangers where there is a fixed number of Volumes, or
      for File storage where you wish to to ensure that the backups made to
      disk files do not become too numerous or consume too much space.</dd>

  <dt>Pool Type = &lt;type&gt;</dt><dd>This record defines the pool
    type, which corresponds to the type of Job being run. It is
    required and may be one of the following:

        <ul>
        <li><b>Backup</b></li>
        <li><b>*Archive</b></li>
        <li><b>*Cloned</b></li>
        <li><b>*Migration</b></li>
        <li><b>*Copy</b></li>
        <li><b>*Save</b></li>
        </ul> 

  <dt>Use Volume Once = &lt;yes/no&gt;</dt><dd>This record
      if set to <b>yes</b> specifies that each volume is to be
      used only once. This is most useful when the Media is a 
      file and you want a new file for each backup that is
      done. The default is <b>no</b> (i.e. use volume any
      number of times). This record will most likely be phased out
      (deprecated), so you are recommended to use <b>Maximum Volume Jobs = 1</b>
      instead. </dd>

  <dt>Maximum Volume Jobs = &lt;positive-integer&gt;</dt><dd>This record specifies
      the maximum number of Jobs that can be written to the Volume. If 
      you specify zero (the default), there is no limit.  Otherwise,
      when the number of Jobs backed up to the Volume equals <b>positive-integer</b>
      the Volume will be marked <b>Used</b>. When the Volume is marked     
      <b>Used</b> it can no longer be used for appending Jobs, much like
      the <b>Full</b> status but it can be recycled if recycling is enabled.     
      By setting <b>MaximumVolumeJobs</b> to one, you get the same 
      effect as setting <b>UseVolumeOnce = yes</b>.</dd>

  <dt>Maximum Volume Files = &lt;positive-integer&gt;</dt><dd>This record specifies
      the maximum number of files that can be written to the Volume. If 
      you specify zero (the default), there is no limit.  Otherwise,
      when the number of files written to the Volume equals <b>positive-integer</b>
      the Volume will be marked <b>Used</b>. When the Volume is marked     
      <b>Used</b> it can no longer be used for appending Jobs, much like
      the <b>Full</b> status but it can be recycled if recycling is enabled.     
      This value is checked and the <b>Used</b> status is set only
      at the end of a job that writes to the particular volume.      
      </dd>

  <dt>Maximum Volume Bytes = &lt;size&gt;</dt><dd>This record specifies
      the maximum number of bytes that can be written to the Volume. If 
      you specify zero (the default), there is no limit except the
      physical size of the Volume.  Otherwise,
      when the number of bytes written to the Volume equals <b>size</b>
      the Volume will be marked <b>Used</b>. When the Volume is marked     
      <b>Used</b> it can no longer be used for appending Jobs, much like
      the <b>Full</b> status but it can be recycled if recycling is enabled.     
      This value is checked and the <b>Used</b> status is set only
      at the end of a job that writes to the particular volume.      
      </dd>

  <dt>Volume Use Duration = &lt;time-period-specification&gt;</dt><dd>
      The Volume Use Duration record defines the time period that   
      the Volume can be written beginning from the time of first data
      write to the Volume. If the time-period specified is zero (the
      default), the Volume can be written indefinitely. Otherwise,
      when the time period from the first write to the volume (the
      first Job written) exceeds the time-period-specification, the
      Volume will be marked <b>Used</b>, which means that no more
      Jobs can be appended to the Volume, but it may be recycled if
      recycling is enabled.                                      
      <p>You might use this record, for example, if you have a Volume
      used for Incremental backups, and Volumes used for Weekly Full
      backups. Once the Full backup is done, you will want to use a 
      different Incremental Volume. This can be accomplished by setting
      the Volume Use Duration for the Incremental Volume to six days.
      I.e. it will be used for the 6 days following a Full save, then
      a different Incremental volume will be used.
      <p>
      This value is checked and the <b>Used</b> status is set only
      at the end of a job that writes to the particular volume, which
      means that even though the use duration may have expired, the
      catalog entry will not be updated until the next job that
      uses this volume is run.   </dd>

  <dt>Catalog Files = &lt;yes/no&gt;</dt><dd>This record
      defines whether or not you want the names of the files   
      that were saved to be put into the catalog. The default
      is <b>yes</b>. The advantage of specifying <b>Catalog Files = No</b>
      is that you will have a significantly smaller Catalog database. The
      disadvantage is that you will not be able to produce a Catalog listing
      of the files backed up for each Job (this is often called Browsing).</dd>

    <a name="PoolAutoPrune"></a>
   <dt>AutoPrune = &lt;yes/no&gt;</dt><dd>If AutoPrune is set to
       <b>yes</b> (default), Bacula (version 1.20 or greater) will
       automatically apply the Volume Retention period when new Volume
       is needed and no appendable Volumes exist in the Pool.  Volume
       pruning causes expired Jobs (older than the <b>Volume
       Retention</b> period) to be deleted from the Catalog and permits
       possible recycling of the Volume.</dd>

    <a name="VolRetention"></a>
   <dt>Volume Retention = &lt;time-period-specification&gt;</dt><dd>The
       Volume Retention record defines the length of time that <b>Bacula</b>
       will keep Job records associated with the Volume in the Catalog
       database.  When this time period expires, and if <b>AutoPrune</b>
       is set to <b>yes</b> <b>Bacula</b> will prune (remove) Job
       records that are older than the specified Volume Retention period.
       All File records associated with pruned Jobs are also pruned.
       This period is specified in seconds, but as a convenience, there
       are a number of modifiers that permit easy specification in terms
       of minutes, hours, days, weeks, months, quarters, or years.
       The <b>Volume Retention</b> applied independently to the  
       <b>Job Retention</b> and the <b>File Retention</b> periods 
       defined in the Client resource. This means that the shorter
       period is the one that applies.
       <p>The default is 365 days. Note, this record sets the default
       value for each Volume entry in the Catalog when the Volume is
       created. The value in the
       catalog may be later individually changed for each Volume using
       the Console program. 
       <p>
       By defining multiple Pools with different Volume Retention periods,
       you may effectively have a set of tapes that is recycled weekly,
       another Pool of tapes that is recycled monthly and so on. </dd>

  <a name="PoolRecycle"></a>
  <dt>Recycle = &lt;yes/no&gt;</dt><dd>This record specifies the 
      default for recycling Purged Volumes. If it is set to <b>yes</b>
      and <b>Bacula</b> needs a volume but finds none that are
      appendable, it will search for Purged Volumes (i.e. volumes
      with all the Jobs and Files expired and thus deleted from
      the Catalog). If the Volume is recycled, all previous data
      written to that Volume will be overwritten.</dd>

  <a name="RecycleOldest"></a>
  <dt>Recycle Oldest Volume = &lt;yes/no&gt;</dt><dd>This record
      instructs the Director to search for the oldest used  
      Volume in the Pool when another Volume is requested by
      the Storage daemon and none are available.
      The catalog is then <b>purged</b> irrespective of retention
      periods of all Files and Jobs written to this Volume.
      The Volume is then recycled and will be used as the next
      Volume to be written. This record overrides any Job,
      File, or Volume retention periods that you may have specified.
      You may find this record particularly useful if you have
      a fixed number of Volumes in the Pool and you want to
      cycle through them and when all Volumes are full, this
      record will cause the oldest volume (oldest FirstWritten
      date) to be purged. If the Volume is marked Recycle yes (1) 
      in the catalog (important), it will then be recycled and
      reused.
      <p><b>Please be aware that <b>Recycle Oldest Volume</b> disregards
      all retention periods.</b> If you have only a single Volume 
      defined and you turn this variable on, that Volume will always
      be immediately overwritten when it fills! So at a minimum,
      ensure that you have a decent number of Volumes in your Pool
      before running any jobs. If you want retention periods to apply
      do not use this record. To specify a retention period,
      use the <b>Volume Retention</b> record (see above).</dd>


  <dt>Accept Any Volume = &lt;yes/no&gt;</dt><dd>This record
      specifies whether or not any volume from the Pool may
      be used for backup.  The default is <b>yes</b> as of version
      1.27 and later. If it is <b>no</b> then only the first
      writable volume in the Pool will be accepted for writing backup
      data, thus forcing Bacula to fill each Volume sequentially
      in turn before using any other appendable volume in the
      Pool. If this is <b>no</b> and you mount a volume out
      of order, <b>Bacula</b> will not accept it.  If this
      is <b>yes</b> any appendable volume from the pool
      mounted will be accepted.
      <p>
      If you are going on vacation and you think the current volume
      may not have enough room on it, you can simply label a new tape
      and leave it in the drive, and assuming that <b>Accept Any Volume</b>
      is <b>yes</b> Bacula will begin writing on it. When you return
      from vacation, simply remount the last tape, and Bacula will
      continue writing on it until it is full.  Then you can remount
      your vacation tape and Bacula will fill it in turn.
      </dd>

  <dt>Cleaning Prefix = &lt;string&gt;</dt><dd>This record defines
      a prefix string, which if it matches the beginning of 
      a Volume olume name during labeling of a Volume, the Volume
      will be defined with the VolStatus set to <b>Cleaning</b> and
      thus <b>Bacula</b> will never attempt to use this tape. This
      is primarily for use with autochangers that accept barcodes
      where the convention is that barcodes beginning with <b>CLN</b>
      are treated as cleaning tapes.</dd>

  <dt>*Label Format = &lt;format&gt;</dt><dd>This record specifies the
      format of the labels contained in this pool. The <b>format</b>
       consists of alpha-numeric characters and the special characters
       hyphen (<b>-</b>), underscore (<b>_</b>), colon (<b>:</b>), and 
       period (<b>.</b>). In addition,
       there are special format commands that are enclosed in brackets
       that are of the form:<p></p>
       <b>[&lt;counter&gt;:&lt;specification&gt] </b><p></p>
       where <b>counter</b> must be a counter as specified on a <b>Counter</b>
       specification (see below), or a special built-in counter, and
       specification is either the name of a <b>FormatList</b> (see below),
       or one of the following format specifications:<p></p>
       &quot;000&quot;, &quot;AAA&quot;, &quot;xxx&quot;<p></p>
       with &quot;xxx&quot; denoting roman numerals.
       <p>The <b>:&lt;specification&gt;</b> is optional and if not
       given, the <b>counter</b> will be edited as a C printf <b>%d</b>
       value would be edited (i.e. a number of arbitrary width
        with no leading zero).</p></dd>

  <dt>*Counter = &lt;counter-name&gt; [&lt;initial-value&gt;] [&lt;maximum-value&gt;]
      [&lt;counter-to-increment&gt;]</dt><dd>
          where <b>counter-name</b> is the name of the counter to be used in
          a subsequent <b>Label Format</b> specification, and <b>initial-value</b> is an
          optional positive integer initial value for the counter, and <b>maximum-value</b>
          is an optional positive integer maximum value for the counter after which the counter
          will be reset to the initial value. The default <b>initial-value</b> is zero.
          The default and maximum <b>maximum-value</b> is 4,294,967,296.
          The optional name, <b>counter-to-increment</b> is the name of
          a counter to be incremented when the maximum value is exceeded (i.e. when
          the counter is reset to the initial value.<p></p>The counter is incremented
          when it is used (encountered in a <b>LabelFormat</b>) followed by a plus sign 
          (e.g. [Counter+:000])
          <p>The following built-in counters exist:</p>
          <dl>
          <dt>Year</dt>
          <dt>Month</dt>
          <dt>Day</dt>
          <dt>Hour</dt>
          <dt>Minute</dt>
          <dt>Second</dt>
          <dt>Week</dt>
          </dl>
          <p>All counters including built-in counters have positive integer values.</p>
          </dd>

  <dt>*Format List = &lt;list-name&gt; = &lt;arbitrary-list&gt;</dt><dd>where
       <b>arbitrary-list</b> is an arbitrary list of quoted strings of the form,
           &quot;item1&quot;, &quot;item2&quot, &quot;item3&quot;, ...</dd>
           <p>The following built-in FormatLists exist:</p>
           <dl>
           <dt>UYear</dt><dd>Universal time and date</dd>
           <dt>JDay</dt><dd>Julian day</dd>
           <dt>Jtime</dt><dd>Julian day fraction</dd>
           <dt>Shost</dt><dd>Storage daemon host name</dd>
           <dt>Bhost</dt><dd>Backed up host name</dd>
           <dt>Site</dt><dd>Site name</dd>
           
           </dl>
           <p>The counter value that precedes a built-in FormatList is
              ignored and may be omitted.</p>
         
</dl>
In order for a Pool to be used during a Backup Job, the Pool must have
at least one Volume associated with it.  Volumes are created
for a Pool using the <b>label</b> or the <b>add</b> commands in the
<b>Bacula Console</b>,
program.  In addition to adding Volumes to the Pool (i.e.  putting the
Volume names in the Catalog database), the physical Volume must be
labeled with valid <b>Bacula</b> software volume label before
<b>Bacula</b> will accept the Volume.  This will be automatically done
if you use the <b>label</b> command.  <b>Bacula</b> can
automatically label Volumes if instructed to do so, but this feature is
not yet fully implemented.

<p>
<p> The following is an
example of a valid Pool resource definition: 
<pre> 
Pool {
  Name = Default
  Pool Type = Backup
}
</pre>


<h1><a name="CatalogResource"></a>The Catalog Resource</h1>
The Catalog Resource defines what catalog to use for the
current job. Currently, <b>Bacula</b> can only handle
a single database server (SQLite, MySQL, built-in) that is 
defined when configuring <b>Bacula</b>. However, there
may be as many Catalogs (databases) defined as you
wish. For example, you may want each Client to have
its own Catalog database, or you may want backup
jobs to use one database and verify or restore
jobs to use another database.

<dl>
  <dt>Catalog</dt><dd>Start of the Catalog records.
     At least one Catalog resource must be defined. </dd>

  <dt>Name = &lt;name&gt;</dt><dd>The name of the Catalog. No 
     necessary relation to the database server name. This name
     will be specified in the Client resource record indicating
     that all catalog data for that Client is maintained in this
     Catalog. This record is required.</dd>

  <dt>password = &lt;password&gt;</dt><dd>This specifies the password
      to use when logging into the database. This record is required.</dd>

  <dt>DB Name = &lt;name&gt;</dt><dd>This specifies the name of the
     database. If you use multiple catalogs (databases), you specify
     which one here. If you are using an external database server
     rather than the internal one, you must specify a name that
     is known to the server (i.e. you explicitly created the
     <b>Bacula</b> tables using this name. This record is
     required. </dd>

  <dt>user = &lt;user&gt;</dt><dd>This specifies what user name
      to use to log into the database. This record is required.</dd>

  <dt>DB Socket = &lt;socket-name&gt;</dt><dd>This is the name of
      a socket to use on the local host to connect to the database.
      This record is used only by MySQL and is ignored by
      SQLite. Normally, if neither <b>DB Socket</b> or <b>DB Address</b>
      are specified, MySQL will use the default socket.</dd>

  <dt>DB Address = &lt;address&gt;</dt><dd>This is the host address
      of the database server. Normally, you would specify this instead
      of <b>DB Socket</b> if the database server is on another machine.
      In that case, you will also specify <b>DB Port</b>. This record
      is used only by MySQL and is ignored by SQLite if provided.
      This record is optional.</dd>

  <dt>*DB Port = &lt;port&gt;</dt><dd>This defines the port to
      be used in conjunction with <b>DB Address</b> to access the
      database if it is on another machine. This record is used
      only by MySQL and is ignored by SQLite if provided. This
      record is optional.</dd>
         
</dl>
The following is an example of a valid Catalog resource definition:
<pre>
Catalog 
{  
  Name = SQLite
  dbname = bacula; 
  user = bacula; 
  password = ""                       # no password = no security
}
</pre>

or for a Catalog on another machine:
<pre>
Catalog
{
  Name = MySQL
  dbname = bacula
  user = bacula
  password = ""
  DB Address = remote.acme.com
  DB Port = 1234
}
</pre>


<h1><a name="MessagesResource"></a>The Messages Resource</h1>
For the details of the Messages Resource, please see the
<a href="messagesres.html">Messages Resource Chapter</a> of
this manual. 




<h1><a name="SampleDirectorConfiguration">
A Complete Example Director Configuration File</a></h1>
An example Director configuration file might be the following:
<pre>
\#
\# Default Bacula Director Configuration file
\#
\#  The only thing that MUST be changed is to add one or more
\#   file or directory names in the Include directive of the
\#   FileSet resource.
\#
\#  For Bacula release 1.15 (5 March 2002) -- redhat
\#
\#  You might also want to change the default email address
\#   from root to your address.  See the "mail" and "operator"
\#   directives in the Messages resource.
\#

Director {                            \# define myself
  Name = rufus-dir
  QueryFile = "/home/kern/bacula/bin/query.sql"
  WorkingDirectory = "/home/kern/bacula/bin/working"
  PidDirectory = "/home/kern/bacula/bin/working"
  SubSysDirectory = "/home/kern/bacula/bin/working"
  Password = "XkSfzu/Cf/wX4L8Zh4G4/yhCbpLcz3YVdmVoQvU3EyF/" 
}

\# Define the backup Job
Job {
  Name = "NightlySave"
  Type = Backup
  Level = Incremental                 # default
  Client=rufus-fd 
  FileSet="Full Set"
  Schedule = "WeeklyCycle"
  Storage = DLTDrive
  Messages = Standard
  Pool = Default
}

Job {
  Name = "Restore"
  Type = Restore
  Client=rufus-fd 
  FileSet="Full Set"
  Where = /tmp/bacula-restores
  Storage = DLTDrive
  Messages = Standard
  Pool = Default
}
   

\# List of files to be backed up
FileSet {
  Name = "Full Set"
  Include = signature=SHA1 { 
\#    
\#  Put your list of files here, one per line or include an
\#    external list with:
\#
\#    @file-name
\#
\#  Note: / backs up everything

  /

  }
  Exclude = { }
}

\# When to do the backups
Schedule {
  Name = "WeeklyCycle"
  Run = Full sun at 1:05
  Run = Incremental mon-sat at 1:05
}

\# Client (File Services) to backup
Client {
  Name = rufus-fd
  Address = rufus
  Catalog = MyCatalog
  Password = "MQk6lVinz4GG2hdIZk1dsKE/LxMZGo6znMHiD7t7vzF+" 
  File Retention = 60d                \# sixty day file retention
  Job Retention = 1y                  \# 1 year Job retention
  AutoPrune = yes                     \# Auto apply retention periods
}


\# Definition of DLT tape storage device
Storage {
  Name = DLTDrive
  Address = rufus
  Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ" 
  Device = "HP DLT 80"                \# same as Device in Storage daemon
  Media Type = DLT8000                \# same as MediaType in Storage daemon
}

\# Definition of DDS tape storage device
Storage {
  Name = SDT-10000
  Address = rufus
  Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ" 
  Device = SDT-10000                  \# same as Device in Storage daemon
  Media Type = DDS-4                  \# same as MediaType in Storage daemon
}

\# Definition of 8mm tape storage device
Storage {
  Name = "8mmDrive"
  Address = rufus
  Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
  Device = "Exabyte 8mm"
  MediaType = "8mm"
}

\# Definition of file storage device
Storage {
  Name = File
  Address = rufus
  Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
  Device = FileStorage
  Media Type = File
}


\# Generic catalog service
Catalog {
  Name = MyCatalog
  dbname = bacula; user = bacula; password = ""
}

\# Reasonable message delivery -- send most everything to email address
\#  and to the console
Messages {
  Name = Standard
  mail = root@localhost = all, !skipped, !terminate
  operator = root@localhost = mount
  console = all, !skipped, !saved
}
    
\# Default pool definition
Pool {
  Name = Default
  Pool Type = Backup
  AutoPrune = yes
  Recycle = yes
}

</pre>

<page_prev name="Bacula Configuration" url="configure.html">
<page_next name="Client/File daemon Configuration" url="filedconf.html">
