Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > df754e4e6f7f5fc8ab9d6ed8559f3e3d > files > 147

bacula-docs-5.0.3-19.fc16.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Configuring the Director</TITLE>
<META NAME="description" CONTENT="Configuring the Director">
<META NAME="keywords" CONTENT="main">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="main.css">

<LINK REL="next" HREF="Client_File_daemon_Configur.html">
<LINK REL="previous" HREF="Customizing_Configuration_F.html">
<LINK REL="up" HREF="Bacula_Main_Reference.html">
<LINK REL="next" HREF="Client_File_daemon_Configur.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1447"
  HREF="Client_File_daemon_Configur.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1441"
  HREF="Bacula_Main_Reference.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1435"
  HREF="Customizing_Configuration_F.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1443"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1445"
  HREF="Thanks.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1448"
  HREF="Client_File_daemon_Configur.html">Client/File daemon Configuration</A>
<B> Up:</B> <A NAME="tex2html1442"
  HREF="Bacula_Main_Reference.html">Bacula Main Reference</A>
<B> Previous:</B> <A NAME="tex2html1436"
  HREF="Customizing_Configuration_F.html">Customizing the Configuration Files</A>
 &nbsp; <B>  <A NAME="tex2html1444"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1446"
  HREF="Thanks.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html1449"
  HREF="Configuring_Director.html#SECTION001810000000000000000">Director Resource Types</A>
<LI><A NAME="tex2html1450"
  HREF="Configuring_Director.html#SECTION001820000000000000000">The Director Resource</A>
<LI><A NAME="tex2html1451"
  HREF="Configuring_Director.html#SECTION001830000000000000000">The Job Resource</A>
<LI><A NAME="tex2html1452"
  HREF="Configuring_Director.html#SECTION001840000000000000000">The JobDefs Resource</A>
<LI><A NAME="tex2html1453"
  HREF="Configuring_Director.html#SECTION001850000000000000000">The Schedule Resource</A>
<LI><A NAME="tex2html1454"
  HREF="Configuring_Director.html#SECTION001860000000000000000">Technical Notes on Schedules</A>
<LI><A NAME="tex2html1455"
  HREF="Configuring_Director.html#SECTION001870000000000000000">The FileSet Resource</A>
<LI><A NAME="tex2html1456"
  HREF="Configuring_Director.html#SECTION001880000000000000000">FileSet Examples</A>
<LI><A NAME="tex2html1457"
  HREF="Configuring_Director.html#SECTION001890000000000000000">Backing up Raw Partitions</A>
<LI><A NAME="tex2html1458"
  HREF="Configuring_Director.html#SECTION0018100000000000000000">Excluding Files and Directories</A>
<LI><A NAME="tex2html1459"
  HREF="Configuring_Director.html#SECTION0018110000000000000000">Windows FileSets</A>
<UL>
<LI><A NAME="tex2html1460"
  HREF="Configuring_Director.html#SECTION0018110010000000000000">A Windows Example FileSet</A>
<LI><A NAME="tex2html1461"
  HREF="Configuring_Director.html#SECTION0018110020000000000000">Windows NTFS Naming Considerations</A>
</UL>
<BR>
<LI><A NAME="tex2html1462"
  HREF="Configuring_Director.html#SECTION0018120000000000000000">Testing Your FileSet</A>
<LI><A NAME="tex2html1463"
  HREF="Configuring_Director.html#SECTION0018130000000000000000">The Client Resource</A>
<LI><A NAME="tex2html1464"
  HREF="Configuring_Director.html#SECTION0018140000000000000000">The Storage Resource</A>
<LI><A NAME="tex2html1465"
  HREF="Configuring_Director.html#SECTION0018150000000000000000">The Pool Resource</A>
<UL>
<LI><A NAME="tex2html1466"
  HREF="Configuring_Director.html#SECTION0018151000000000000000">The Scratch Pool</A>
</UL>
<BR>
<LI><A NAME="tex2html1467"
  HREF="Configuring_Director.html#SECTION0018160000000000000000">The Catalog Resource</A>
<LI><A NAME="tex2html1468"
  HREF="Configuring_Director.html#SECTION0018170000000000000000">The Messages Resource</A>
<LI><A NAME="tex2html1469"
  HREF="Configuring_Director.html#SECTION0018180000000000000000">The Console Resource</A>
<LI><A NAME="tex2html1470"
  HREF="Configuring_Director.html#SECTION0018190000000000000000">The Counter Resource</A>
<LI><A NAME="tex2html1471"
  HREF="Configuring_Director.html#SECTION0018200000000000000000">Example Director Configuration File</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION001800000000000000000"></A>
<A NAME="DirectorChapter"></A>
<BR>
Configuring the Director
</H1>
<A NAME="6558"></A>
<A NAME="6559"></A>

<P>
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 files and resources including the
data types recognized by <B>Bacula</B>. Please see the 
ConfigurationConfigureChapter chapter of this manual. 

<P>

<H1><A NAME="SECTION001810000000000000000">
Director Resource Types</A>
</H1>
<A NAME="6565"></A>
<A NAME="6566"></A>

<P>
Director resource type may be one of the following: 

<P>
Job, JobDefs, Client, Storage, Catalog, Schedule, FileSet, Pool, Director,  or
Messages. We present them here in the most logical order for defining them: 

<P>
Note, everything revolves around a job and is tied to a job in one
way or another.

<P>

<UL>
<LI>DirectorDirectorResource4 - 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.  If you have either <B>/dev/random</B> or  <B>bc</B> on your
   machine, Bacula will generate a random password during the configuration
   process, otherwise it will  be left blank. 
</LI>
<LI>JobJobResource - to define the backup/restore Jobs 
   and to tie together the Client, FileSet and Schedule resources to  be used
   for each Job. Normally, you will Jobs of different names corresponding
   to each client (i.e. one Job per client, but a different one with a different name
   for each client).
</LI>
<LI>JobDefsJobDefsResource - optional resource for 
   providing defaults for Job resources.  
</LI>
<LI>ScheduleScheduleResource - to define when a Job is to 
   be automatically run by <B>Bacula's</B> internal scheduler. You 
   may have any number of Schedules, but each job will reference only
   one.
</LI>
<LI>FileSetFileSetResource - to define the set of files 
   to be backed up for each Client. You may have any number of
   FileSets but each Job will reference only one.
</LI>
<LI>ClientClientResource2 - to define what Client is to be
   backed up. You will generally have multiple Client definitions. Each 
   Job will reference only a single client.
</LI>
<LI>StorageStorageResource2 - to define on what physical
   device the Volumes should be mounted. You may have one or
   more Storage definitions.
</LI>
<LI>PoolPoolResource - to define the pool of Volumes
   that can be used for a particular Job. Most people use a
   single default Pool.  However, if you have a large number
   of clients or volumes, you may want to have multiple Pools.
   Pools allow you to restrict a Job (or a Client) to use
   only a particular set of Volumes.
</LI>
<LI>CatalogCatalogResource - to define in what database to
   keep the list of files and the Volume names where they are backed up.  
   Most people only use a single catalog.  However, if you want to
   scale the Director to many clients, multiple catalogs can be helpful.
   Multiple catalogs require a bit more management because in general
   you must know what catalog contains what data.  Currently, all 
   Pools are defined in each catalog.  This restriction will be removed
   in a later release.
</LI>
<LI>MessagesMessagesChapter - to define where error and
   information messages are to be sent or logged. You may define
   multiple different message resources and hence direct particular
   classes of messages to different users or locations (files, ...).
</LI>
</UL>

<P>

<H1><A NAME="SECTION001820000000000000000"></A>
<A NAME="DirectorResource4"></A>
<BR>
The Director Resource
</H1>
<A NAME="6594"></A>
<A NAME="6595"></A>

<P>
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. 

<P>
<DL>
<DT><STRONG>Director</STRONG></DT>
<DD><A NAME="6597"></A>
   Start of the Director resource. One and only one  director resource must be
supplied.  

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="6600"></A>
   <A NAME="6601"></A>
   The director name used by the system  administrator. This directive is
required.  

<P>
</DD>
<DT><STRONG>Description = text</STRONG></DT>
<DD><A NAME="6604"></A>
   <A NAME="6605"></A>
   The text field contains a  description of the Director that will be displayed
in the  graphical user interface. This directive is optional.  

<P>
</DD>
<DT><STRONG>Password = UA-password</STRONG></DT>
<DD><A NAME="6608"></A>
   <A NAME="6609"></A>
   Specifies the password that must be supplied for the default 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 passed across the network but instead a
   challenge response hash code created with the password.  This directive
   is required.  If you have either <B>/dev/random</B> or <B>bc</B> on your
   machine, Bacula will generate a random password during the configuration
   process, otherwise it will be left blank and you must manually supply
   it.

<P>
The password is plain text.  It is not generated through any special
   process but as noted above, it is better to use random text for 
   security reasons.

<P>
</DD>
<DT><STRONG>Messages = Messages-resource-name</STRONG></DT>
<DD><A NAME="6615"></A>
   <A NAME="6616"></A>
   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
   directive is required.  

<P>
</DD>
<DT><STRONG>Working Directory = Directory</STRONG></DT>
<DD><A NAME="6619"></A>
   <A NAME="6620"></A>
   This directive  is mandatory and specifies a directory in which the Director 
   may put its status files. This directory should be used only  by Bacula but
   may be shared by other Bacula daemons. However, please note, if this
   directory is shared with other Bacula daemons (the File daemon and Storage
   daemon), you must ensure that the <B>Name</B> given to each daemon is
   unique so that the temporary filenames used do not collide.  By default
   the Bacula configure process creates unique daemon names by postfixing them
   with -dir, -fd, and -sd. 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 directive is required.
   The working directory specified must already exist and be
   readable and writable by the Bacula daemon referencing it.

<P>
If you have specified a Director user and/or a Director group on your
   ./configure line with <B>-with-dir-user</B> and/or 
   <B>-with-dir-group</B> the Working Directory owner and group will
   be set to those values.

<P>
</DD>
<DT><STRONG>Pid Directory = Directory</STRONG></DT>
<DD><A NAME="6630"></A>
   <A NAME="6631"></A>
   This directive  is mandatory and specifies a directory in which the Director 
   may put its process Id file. The process Id file is used to  shutdown
   Bacula and to prevent multiple copies of  Bacula 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>
The PID directory specified must already exist and be
   readable and writable by the Bacula daemon referencing it

<P>
Typically on Linux systems, you will set this to:  <B>/var/run</B>. If you are
   not installing Bacula in the  system directories, you can use the <B>Working
   Directory</B> as  defined above.  This directive is required.  

<P>
</DD>
<DT><STRONG>Scripts Directory = Directory</STRONG></DT>
<DD><A NAME="6638"></A>
   <A NAME="6639"></A>
   This directive is optional and, if defined, specifies a directory in
   which the Director will look for the Python startup script <B>   DirStartup.py</B>.  This directory may be shared by other Bacula daemons.
   Standard shell expansion of the directory is done when the configuration
   file is read so that values such as <B>$HOME</B> will be properly
   expanded.

<P>
</DD>
<DT><STRONG>QueryFile = Path</STRONG></DT>
<DD><A NAME="6644"></A>
   <A NAME="6645"></A>
   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 directive is required.

<P>
</DD>
<DT><STRONG>Heartbeat Interval = time-interval</STRONG></DT>
<DD><A NAME="6651"></A>
   <A NAME="6652"></A>
   This directive is optional and if specified will cause the Director to
   set a keepalive interval (heartbeat) in seconds on each of the sockets
   it opens for the Client resource.  This value will override any
   specified at the Director level.  It is implemented only on systems
   (Linux, ...) that provide the <B>setsockopt</B> TCP_KEEPIDLE function.
   The default value is zero, which means no change is made to the socket.

<P>
<A NAME="DirMaxConJobs"></A></DD>
<DT><STRONG>Maximum Concurrent Jobs = number</STRONG></DT>
<DD><A NAME="6657"></A>
   <A NAME="6658"></A>
   <A NAME="6659"></A>
   <A NAME="6660"></A>
   where number  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.  

<P>
The Volume format becomes more complicated with 
   multiple simultaneous jobs, consequently, restores may take longer if
   Bacula must sort through interleaved volume blocks from  multiple simultaneous
   jobs. This can be avoided by having each simultaneous job write to
   a different volume or  by using data spooling, which will first spool the data
   to disk simultaneously, then write one spool file at a time to the volume
   thus avoiding excessive interleaving of the different job blocks.

<P>
</DD>
<DT><STRONG>FD Connect Timeout = time</STRONG></DT>
<DD><A NAME="6665"></A>
   <A NAME="6666"></A>
   where <B>time</B> is the time 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.

<P>
</DD>
<DT><STRONG>SD Connect Timeout = time</STRONG></DT>
<DD><A NAME="6670"></A>
   <A NAME="6671"></A>
   where <B>time</B> is the time 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.

<P>
</DD>
<DT><STRONG>DirAddresses = IP-address-specification</STRONG></DT>
<DD><A NAME="6675"></A>
   <A NAME="6676"></A>
   <A NAME="6677"></A>
   <A NAME="6678"></A>
   Specify the ports and addresses on which the Director daemon will listen
   for Bacula Console connections.  Probably the simplest way to explain
   this is to show an example:

<P>
<PRE>
 DirAddresses  = { 
    ip = { addr = 1.2.3.4; port = 1205;}
    ipv4 = {
        addr = 1.2.3.4; port = http;}
    ipv6 = {
        addr = 1.2.3.4;
        port = 1205;
    }
    ip = {
        addr = 1.2.3.4
        port = 1205
    }
    ip = { addr = 1.2.3.4 }
    ip = { addr = 201:220:222::2 }
    ip = {
        addr = bluedot.thun.net
    }
}
</PRE>
<P>
where ip, ip4, ip6, addr, and port are all keywords. Note, that  the address
can be specified as either a dotted quadruple, or  IPv6 colon notation, or as
a symbolic name (only in the ip specification).  Also, port can be specified
as a number or as the mnemonic value from  the /etc/services file.  If a port
is not specified, the default will be used. If an ip  section is specified,
the resolution can be made either by IPv4 or  IPv6. If ip4 is specified, then
only IPv4 resolutions will be permitted,  and likewise with ip6. 

<P>
Please note that if you use the DirAddresses directive, you must
not use either a DirPort or a DirAddress directive in the same 
resource.

<P>
</DD>
<DT><STRONG>DirPort = port-number</STRONG></DT>
<DD><A NAME="6683"></A>
   <A NAME="6684"></A>
   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 directive need not be specified.  This
   directive should not be used if you specify DirAddresses (N.B plural)
   directive.

<P>
</DD>
<DT><STRONG>DirAddress = IP-Address</STRONG></DT>
<DD><A NAME="6687"></A>
   <A NAME="6688"></A>
   This directive is optional, but 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 directive is
   not specified, the Director will bind to any available address (the
   default).  Note, unlike the DirAddresses specification noted above, this
   directive only permits a single address to be specified.  This directive
   should not be used if you specify a DirAddresses (N.B. plural) directive.

<P>
</DD>
<DT><STRONG>DirSourceAddress = IP-Address</STRONG></DT>
<DD><A NAME="6692"></A>
   <A NAME="6693"></A>
   This record is optional, and if it is specified, it will cause the Director
   server (when initiating connections to a storage or file daemon) to source
   its connections from the specified address.  Only a single IP address may be
   specified.  If this record is not specified, the Director server will source
   its outgoing connections according to the system routing table (the default).

<P>
</DD>
<DT><STRONG>Statistics Retention = time</STRONG></DT>
<DD><A NAME="6696"></A>
   <A NAME="6697"></A>
   <A NAME="PruneStatistics"></A>
<P>
The <TT>Statistics Retention</TT> directive defines the length of time that
   Bacula will keep statistics job records in the Catalog database after the
   Job End time. (In <TT>JobHistory</TT> table) When this time period expires,
   and if user runs <TT>prune stats</TT> command, Bacula will prune (remove)
   Job records that are older than the specified period.

<P>
Theses statistics records aren't use for restore purpose, but mainly for
   capacity planning, billings, etc. See Statistics chapter for
   additional information.

<P>
See the  Configuration chapterTime of this manual for additional
   details of time specification.

<P>
The default is 5 years.

<P>
</DD>
<DT><STRONG>VerId = string</STRONG></DT>
<DD><A NAME="6707"></A>
  where  string is an identifier which can be used for support purpose.
  This string is displayed using the <TT>version</TT> command.

<P>
</DD>
<DT><STRONG>MaximumConsoleConnections = number</STRONG></DT>
<DD><A NAME="6713"></A>
  <A NAME="6714"></A>
  <A NAME="6715"></A>
   where number  is the maximum number of Console Connections that
   could run  concurrently. The default is set to 20, but you may set it to a 
   larger number.

<P>
</DD>
</DL>

<P>
The following is an example of a valid Director resource definition: 

<P>
<PRE>
Director {
  Name = HeadMan
  WorkingDirectory = "$HOME/bacula/bin/working"
  Password = UA_password
  PidDirectory = "$HOME/bacula/bin/working"
  QueryFile = "$HOME/bacula/bin/query.sql"
  Messages = Standard
}
</PRE>
<P>

<H1><A NAME="SECTION001830000000000000000"></A>
<A NAME="JobResource"></A>
<BR>
The Job Resource
</H1>
<A NAME="6723"></A>
<A NAME="6724"></A>

<P>
The Job resource defines a Job (Backup, Restore, ...) that Bacula must
perform. Each Job resource definition contains the name of a Client and
a FileSet to backup, 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. Note, the FileSet must
be specified for a restore job for historical reasons, but it is no longer used.

<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. 

<P>
Note, you define only a single Job to do the Full, Differential, and
Incremental backups since the different backup levels are tied together by 
a unique Job name.  Normally, you will have only one Job per Client, but   
if a client has a really huge number of files (more than several million),
you might want to split it into to Jobs each with a different FileSet
covering only part of the total files.

<P>
Multiple Storage daemons are not currently supported for Jobs, so if
you do want to use multiple storage daemons, you will need to create
a different Job and ensure that for each Job that the combination of
Client and FileSet are unique.  The Client and FileSet are what Bacula
uses to restore a client, so if there are multiple Jobs with the same
Client and FileSet or multiple Storage daemons that are used, the
restore will not work.  This problem can be resolved by defining multiple
FileSet definitions (the names must be different, but the contents of
the FileSets may be the same).

<P>
<DL>
<DT><STRONG>Job</STRONG></DT>
<DD><A NAME="6728"></A>
   <A NAME="6729"></A>
   Start of the Job resource. At least one Job  resource is required. 

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="6732"></A>
   <A NAME="6733"></A>
   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 directive is required. 

<P>
</DD>
<DT><STRONG>Enabled = yesno</STRONG></DT>
<DD><A NAME="6738"></A>
  <A NAME="6739"></A>
  This directive allows you to enable or disable automatic execution
  via the scheduler of a Job.

<P>
</DD>
<DT><STRONG>Type = job-type</STRONG></DT>
<DD><A NAME="6742"></A>
   <A NAME="6743"></A>
   The <B>Type</B> directive 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
   directive  is required. Within a particular Job Type, there are also Levels 
   as discussed in the next item.  

<P>
<DL>
<DT><STRONG>Backup</STRONG></DT>
<DD><A NAME="6750"></A>
   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. 

<P>
</DD>
<DT><STRONG>Restore</STRONG></DT>
<DD><A NAME="6751"></A>
   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 database entries are generated since no Files are
   saved.

<P>
<B>Restore</B> jobs cannot be
   automatically started by the scheduler as is the case for Backup, Verify
   and Admin jobs. To restore files, you must use the <B>restore</B> command
   in the console.

<P>
</DD>
<DT><STRONG>Verify</STRONG></DT>
<DD><A NAME="6754"></A>
   Run a verify Job. In general, <B>verify</B>  jobs permit you to compare the
   contents of the catalog  to the file system, or to what was backed up. In
   addition,  to verifying that a tape that was written can be read,  you can
   also use <B>verify</B> as a sort of tripwire  intrusion detection.  

<P>
</DD>
<DT><STRONG>Admin</STRONG></DT>
<DD><A NAME="6757"></A>
   Run an 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>

<P>
<A NAME="Level"></A>
<P>
</DD>
<DT><STRONG>Level = job-level</STRONG></DT>
<DD><A NAME="6764"></A>
<A NAME="6765"></A>
   The Level directive specifies the default Job level to be run.  Each
   different Job Type (Backup, Restore, ...) has a different set of Levels
   that can be specified.  The Level is normally overridden by a different
   value that is specified in the <B>Schedule</B> resource.  This directive
   is not required, but must be specified either by a <B>Level</B> directive
   or as an override specified in the <B>Schedule</B> resource.

<P>
For a <B>Backup</B> Job, the Level may be one of the  following:  

<P>
<DL>
<DT><STRONG>Full</STRONG></DT>
<DD><A NAME="6771"></A>
   When the Level is set to Full all files in the FileSet whether or not
   they have changed will be backed up.

<P>
</DD>
<DT><STRONG>Incremental</STRONG></DT>
<DD><A NAME="6772"></A>
   When the Level is set to Incremental all files specified in the FileSet
   that have changed since the last successful backup of the the same Job
   using the same FileSet and Client, will be backed up.  If the Director
   cannot find a previous valid Full backup then the job will be upgraded
   into a Full backup.  When the Director looks for a valid backup record
   in the catalog database, it looks for a previous Job with:

<P>

<UL>
<LI>The same Job name.  
</LI>
<LI>The same Client name.  
</LI>
<LI>The same FileSet (any change to the definition of  the FileSet such as
   adding or deleting a file in the  Include or Exclude sections constitutes a
   different FileSet.  
</LI>
<LI>The Job was a Full, Differential, or Incremental backup.  
</LI>
<LI>The Job terminated normally (i.e. did not fail or was not  canceled).  
</LI>
<LI>The Job started no longer ago than <B>Max Full Interval</B>.
</LI>
</UL>

<P>
If all the above conditions do not hold, the Director will upgrade  the
   Incremental to a Full save. Otherwise, the Incremental  backup will be
   performed as requested.  

<P>
The File daemon (Client) decides which files to backup for an
   Incremental backup by comparing start time of the prior Job (Full,
   Differential, or Incremental) against the time each file was last
   "modified" (st_mtime) and the time its attributes were last
   "changed"(st_ctime).  If the file was modified or its attributes
   changed on or after this start time, it will then be backed up.

<P>
Some virus scanning software may change st_ctime while
   doing the scan.  For example, if the virus scanning program attempts to
   reset the access time (st_atime), which Bacula does not use, it will
   cause st_ctime to change and hence Bacula will backup the file during
   an Incremental or Differential backup.  In the case of Sophos virus
   scanning, you can prevent it from resetting the access time (st_atime)
   and hence changing st_ctime by using the <B><code>--</code>no-reset-atime</B>
   option.  For other software, please see their manual.

<P>
When Bacula does an Incremental backup, all modified files that are
   still on the system are backed up.  However, any file that has been
   deleted since the last Full backup remains in the Bacula catalog,
   which means that if between a Full save and the time you do a
   restore, some files are deleted, those deleted files will also be
   restored.  The deleted files will no longer appear in the catalog
   after doing another Full save.

<P>
In addition, if you move a directory rather than copy it, the files in
   it do not have their modification time (st_mtime) or their attribute
   change time (st_ctime) changed.  As a consequence, those files will
   probably not be backed up by an Incremental or Differential backup which
   depend solely on these time stamps.  If you move a directory, and wish
   it to be properly backed up, it is generally preferable to copy it, then
   delete the original.

<P>
However, to manage deleted files or directories changes in the
   catalog during an Incremental backup you can use <TT>accurate</TT>
   mode. This is quite memory consuming process. See Accurate
     modeaccuratemode for more details.

<P>
</DD>
<DT><STRONG>Differential</STRONG></DT>
<DD><A NAME="6780"></A>
   When the Level is set to Differential
   all files specified in the FileSet that have changed since the last
   successful Full backup of the same Job will be backed up.
   If the Director cannot find a
   valid previous Full backup for the same Job, FileSet, and Client,
   backup, then the Differential job will be upgraded into a Full backup.
   When the Director looks for a valid Full backup record in the catalog
   database, it looks for a previous Job with:

<P>

<UL>
<LI>The same Job name.  
</LI>
<LI>The same Client name.  
</LI>
<LI>The same FileSet (any change to the definition of  the FileSet such as
   adding or deleting a file in the  Include or Exclude sections constitutes a
   different FileSet.  
</LI>
<LI>The Job was a FULL backup.  
</LI>
<LI>The Job terminated normally (i.e. did not fail or was not  canceled).  
</LI>
<LI>The Job started no longer ago than <B>Max Full Interval</B>.
</LI>
</UL>

<P>
If all the above conditions do not hold, the Director will  upgrade the
   Differential to a Full save. Otherwise, the  Differential backup will be
   performed as requested.  

<P>
The File daemon (Client) decides which files to backup for a
   differential backup by comparing the start time of the prior Full backup
   Job against the time each file was last "modified" (st_mtime) and the
   time its attributes were last "changed" (st_ctime).  If the file was
   modified or its attributes were changed on or after this start time, it
   will then be backed up.  The start time used is displayed after the <B>   Since</B> on the Job report.  In rare cases, using the start time of the
   prior backup may cause some files to be backed up twice, but it ensures
   that no change is missed.  As with the Incremental option, you should
   ensure that the clocks on your server and client are synchronized or as
   close as possible to avoid the possibility of a file being skipped.
   Note, on versions 1.33 or greater Bacula automatically makes the
   necessary adjustments to the time between the server and the client so
   that the times Bacula uses are synchronized.

<P>
When Bacula does a Differential backup, all modified files that are
   still on the system are backed up.  However, any file that has been
   deleted since the last Full backup remains in the Bacula catalog, which
   means that if between a Full save and the time you do a restore, some
   files are deleted, those deleted files will also be restored.  The
   deleted files will no longer appear in the catalog after doing another
   Full save.  However, to remove deleted files from the catalog during a
   Differential backup is quite a time consuming process and not currently
   implemented in Bacula.  It is, however, a planned future feature.

<P>
As noted above, if you move a directory rather than copy it, the
   files in it do not have their modification time (st_mtime) or
   their attribute change time (st_ctime) changed.  As a
   consequence, those files will probably not be backed up by an
   Incremental or Differential backup which depend solely on these
   time stamps.  If you move a directory, and wish it to be
   properly backed up, it is generally preferable to copy it, then
   delete the original. Alternatively, you can move the directory, then
   use the <B>touch</B> program to update the timestamps.

<P>
However, to manage deleted files or directories changes in the
   catalog during an Differential backup you can use <TT>accurate</TT>
   mode. This is quite memory consuming process. See Accurate
     modeaccuratemode for more details.

<P>
Every once and a while, someone asks why we need Differential
   backups as long as Incremental backups pickup all changed files.
   There are possibly many answers to this question, but the one
   that is the most important for me is that a Differential backup
   effectively merges
   all the Incremental and Differential backups since the last Full backup
   into a single Differential backup.  This has two effects: 1.  It gives
   some redundancy since the old backups could be used if the merged backup
   cannot be read.  2.  More importantly, it reduces the number of Volumes
   that are needed to do a restore effectively eliminating the need to read
   all the volumes on which the preceding Incremental and Differential
   backups since the last Full are done.

<P>
</DD>
</DL>

<P>
For a <B>Restore</B> Job, no level needs to be specified.  

<P>
For a <B>Verify</B> Job, the Level may be one of the  following:  

<P>
<DL>
<DT><STRONG>InitCatalog</STRONG></DT>
<DD><A NAME="6793"></A>
   does a scan of the specified <B>FileSet</B> and stores the file
   attributes in the Catalog database.  Since no file data is saved, 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 the <B>InitCatalog</B> level verify one time when your system is
   first setup, and then once again after each modification (upgrade) to
   your system.  Thereafter, when your want to check the state of your
   system files, you use a <B>Verify</B> <B>level = Catalog</B>.  This
   compares the results of your <B>InitCatalog</B> with the current state of
   the files.

<P>
</DD>
<DT><STRONG>Catalog</STRONG></DT>
<DD><A NAME="6803"></A>
   Compares the current state of the files against the state 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
   Verify Catalog modifies the Catalog database while running in order to
   track new files.

<P>
</DD>
<DT><STRONG>VolumeToCatalog</STRONG></DT>
<DD><A NAME="6809"></A>
   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 compared, 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.

<P>
</DD>
<DT><STRONG>DiskToCatalog</STRONG></DT>
<DD><A NAME="6811"></A>
   This level causes Bacula to read the files as they currently are on
   disk, and to compare the current file attributes with the attributes
   saved in the catalog from the last backup for the job specified on the
   <B>VerifyJob</B> directive.  This level differs from the <B>Catalog</B>
   level described above by the fact that it doesn't compare against a
   previous Verify job but against a previous backup.  When you run this
   level, you must supply the verify options on your Include statements.
   Those options determine what attribute fields are compared.

<P>
This command can be very useful if you have disk problems because it
   will compare the current state of your disk against the last successful
   backup, which may be several jobs.

<P>
Note, the current implementation (1.32c) does not identify files that
   have been deleted.
</DD>
</DL>

<P>
</DD>
<DT><STRONG>Accurate = yesno</STRONG></DT>
<DD><A NAME="6818"></A>
   In accurate mode, the File daemon knowns exactly which files were present
   after the last backup. So it is able to handle deleted or renamed files.

<P>
When restoring a FileSet for a specified date (including "most
   recent"), Bacula is able to restore exactly the files and
   directories that existed at the time of the last backup prior to
   that date including ensuring that deleted files are actually deleted,
   and renamed directories are restored properly.

<P>
In this mode, the File daemon must keep data concerning all files in
   memory.  So you do not have sufficient memory, the restore may
   either be terribly slow or fail.

<P>
For 500.000 files (a typical desktop linux system), it will require
   approximately 64 Megabytes of RAM on your File daemon to hold the
   required information.

<P>
</DD>
<DT><STRONG>Verify Job = Job-Resource-Name</STRONG></DT>
<DD><A NAME="6821"></A>
   <A NAME="6822"></A>
   If you run a verify job without this directive, the last job run will be
   compared with the catalog, which means that you must immediately follow
   a backup by a verify command.  If you specify a <B>Verify Job</B> Bacula
   will find the last job with that name that ran.  This permits you to run
   all your backups, then run Verify jobs on those that you wish to be
   verified (most often a <B>VolumeToCatalog</B>) so that the tape just
   written is re-read.

<P>
</DD>
<DT><STRONG>JobDefs = JobDefs-Resource-Name</STRONG></DT>
<DD><A NAME="6827"></A>
<A NAME="6828"></A>
   If a JobDefs-Resource-Name is specified, all the values contained in the
   named JobDefs resource will be used as the defaults for the current Job.
   Any value that you explicitly define in the current Job resource, will
   override any defaults specified in the JobDefs resource.  The use of
   this directive permits writing much more compact Job resources where the
   bulk of the directives are defined in one or more JobDefs.  This is
   particularly useful if you have many similar Jobs but with minor
   variations such as different Clients.  A simple example of the use of
   JobDefs is provided in the default bacula-dir.conf file.

<P>
</DD>
<DT><STRONG>Bootstrap = bootstrap-file</STRONG></DT>
<DD><A NAME="6831"></A>
<A NAME="6832"></A>
   The Bootstrap directive 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 directive is optional, and if specified, it is
   used only for a restore job.  In addition, when running a Restore job
   from the 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
   Restoring Files with the Bootstrap FileBootstrapChapter chapter
   of this manual.

<P>
<A NAME="writebootstrap"></A></DD>
<DT><STRONG>Write Bootstrap =  bootstrap-file-specification</STRONG></DT>
<DD><A NAME="6843"></A>
<A NAME="6844"></A>
   The <B>writebootstrap</B> directive specifies a file name where Bacula
   will write a <B>bootstrap</B> file for each Backup job run.  This
   directive applies only to Backup Jobs.  If the Backup job is a Full
   save, Bacula will erase any current contents of the specified file
   before writing the bootstrap records.  If the Job is an Incremental
   or Differential
   save, Bacula 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.  Alternatively, you should copy the bootstrap file to another
   machine after it is updated. Note, it is a good idea to write a separate
   bootstrap file for each Job backed up including the job that backs up
   your catalog database.

<P>
If the <B>bootstrap-file-specification</B> begins with a vertical bar
   (<code>|</code>), 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>
On versions 1.39.22 or greater, before opening the file or executing the
   specified command, Bacula performs 
   character substitutioncharacter substitution like in RunScript
   directive. To automatically manage your bootstrap files, you can use
   this in your <B>JobDefs</B> resources:
<PRE>
JobDefs {
   Write Bootstrap = "%c_%n.bsr"
   ...
}
</PRE>

<P>
For more details on using this file, please see the chapter entitled
   The Bootstrap FileBootstrapChapter of this manual.

<P>
</DD>
<DT><STRONG>Client = client-resource-name</STRONG></DT>
<DD><A NAME="6857"></A>
<A NAME="6858"></A>
   The Client directive  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  
   Client Resource sectionClientResource2 of this chapter.
   This directive is required. 

<P>
</DD>
<DT><STRONG>FileSet = FileSet-resource-name</STRONG></DT>
<DD><A NAME="6863"></A>
<A NAME="6864"></A>
   The FileSet directive 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 FileSet Resource sectionFileSetResource of
   this chapter.  This directive is required.

<P>
</DD>
<DT><STRONG>Messages = messages-resource-name</STRONG></DT>
<DD><A NAME="6869"></A>
<A NAME="6870"></A>
   The Messages directive 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
   Messages ResourceMessagesChapter Chapter of this manual.  This
   directive is required.

<P>
</DD>
<DT><STRONG>Pool = pool-resource-name</STRONG></DT>
<DD><A NAME="6875"></A>
<A NAME="6876"></A>
   The Pool directive 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 Pool Resource
   sectionPoolResource of this chapter.  This directive is required.

<P>
</DD>
<DT><STRONG>Full Backup Pool = pool-resource-name</STRONG></DT>
<DD><A NAME="6882"></A>
<A NAME="6883"></A>
   The <I>Full Backup Pool</I> specifies a Pool to be used for Full backups.
   It will override any Pool specification during a Full backup.  This
   directive is optional.

<P>
</DD>
<DT><STRONG>Differential Backup Pool = pool-resource-name</STRONG></DT>
<DD><A NAME="6887"></A>
<A NAME="6888"></A>
   The <I>Differential Backup Pool</I> specifies a Pool to be used for
   Differential backups.  It will override any Pool specification during a
   Differential backup.  This directive is optional.

<P>
</DD>
<DT><STRONG>Incremental Backup Pool = pool-resource-name</STRONG></DT>
<DD><A NAME="6892"></A>
<A NAME="6893"></A>
   The <I>Incremental Backup Pool</I> specifies a Pool to be used for
   Incremental backups.  It will override any Pool specification during an
   Incremental backup.  This directive is optional.

<P>
</DD>
<DT><STRONG>Schedule = schedule-name</STRONG></DT>
<DD><A NAME="6897"></A>
<A NAME="6898"></A>
   The Schedule directive defines what schedule is to be used for the Job.
   The schedule in turn determines when the Job will be automatically
   started and what Job level (i.e.  Full, Incremental, ...) is to be run.
   This directive is optional, and if left out, the Job can only be started
   manually 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> directives, which allow you to run the Job at
   many different times, and each <B>run</B> directive permits overriding
   the default Job Level Pool, Storage, and Messages resources.  This gives
   considerable flexibility in what can be done with a single Job.  For
   additional details, see the Schedule Resource
   ChapterScheduleResource of this manual.

<P>
</DD>
<DT><STRONG>Storage = storage-resource-name</STRONG></DT>
<DD><A NAME="6905"></A>
<A NAME="6906"></A>
   The Storage directive defines the name of the storage services where you
   want to backup the FileSet data.  For additional details, see the
   Storage Resource ChapterStorageResource2 of this manual.
   The Storage resource may also be specified in the Job's Pool resource,
   in which case the value in the Pool resource overrides any value
   in the Job. This Storage resource definition is not required by either
   the Job resource or in the Pool, but it must be specified in
   one or the other, if not an error will result.

<P>
</DD>
<DT><STRONG>Max Start Delay = time</STRONG></DT>
<DD><A NAME="6911"></A>
<A NAME="6912"></A>
   The time specifies 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.

<P>
</DD>
<DT><STRONG>Max Run Time = time</STRONG></DT>
<DD><A NAME="6915"></A>
<A NAME="6916"></A>
   The time specifies the maximum allowed time that a job may run, counted
   from when the job starts, (<B>not</B> necessarily the same as when the
   job was scheduled).

<P>
</DD>
<DT><STRONG>Incremental|Differential Max Wait Time = time</STRONG></DT>
<DD><A NAME="6920"></A>
<A NAME="6921"></A>
<A NAME="6922"></A>
    Theses directives have been deprecated in favor of
    <TT>Incremental|Differential Max Run Time</TT> since bacula 2.3.18.

<P>
</DD>
<DT><STRONG>Incremental Max Run Time = time</STRONG></DT>
<DD><A NAME="6926"></A>
<A NAME="6927"></A>
The time specifies the maximum allowed time that an Incremental backup job may
run, counted from when the job starts, (<B>not</B> necessarily the same as when
the job was scheduled).

<P>
</DD>
<DT><STRONG>Differential Max Wait Time = time</STRONG></DT>
<DD><A NAME="6931"></A>
<A NAME="6932"></A>
The time specifies the maximum allowed time that a Differential backup job may
run, counted from when the job starts, (<B>not</B> necessarily the same as when
the job was scheduled).

<P>
</DD>
<DT><STRONG>Max Run Sched Time = time</STRONG></DT>
<DD><A NAME="6936"></A>
<A NAME="6937"></A>

<P>
The time specifies the maximum allowed time that a job may run, counted from
when the job was scheduled. This can be useful to prevent jobs from running
during working hours. We can see it like <TT>Max Start Delay + Max Run
  Time</TT>.

<P>
</DD>
<DT><STRONG>Max Wait Time = time</STRONG></DT>
<DD><A NAME="6941"></A>
<A NAME="6942"></A>
   The time specifies the maximum allowed time that a job may block waiting
   for a resource (such as waiting for a tape to be mounted, or waiting for
   the storage or file daemons to perform their duties), counted from the
   when the job starts, (<B>not</B> necessarily the same as when the job was
   scheduled). This directive works as expected since bacula 2.3.18.

<P>

<DIV ALIGN="CENTER"><A NAME="fig:differenttime"></A><A NAME="6946"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 17.1:</STRONG>
Job time control directives</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER">  <IMG
 WIDTH="586" HEIGHT="304" ALIGN="BOTTOM" BORDER="0"
 SRC="img15.png"
 ALT="\includegraphics[width=13cm]{different_time.eps}">
  </DIV></TD></TR>
</TABLE>
</DIV>

<P>
</DD>
<DT><STRONG>Max Full Interval = time</STRONG></DT>
<DD><A NAME="6951"></A>
<A NAME="6952"></A>
   The time specifies the maximum allowed age (counting from start time) of
   the most recent successful Full backup that is required in order to run
   Incremental or Differential backup jobs. If the most recent Full backup
   is older than this interval, Incremental and Differential backups will be
   upgraded to Full backups automatically. If this directive is not present,
   or specified as 0, then the age of the previous Full backup is not
   considered.

<P>
<A NAME="PreferMountedVolumes"></A></DD>
<DT><STRONG>Prefer Mounted Volumes = yesno</STRONG></DT>
<DD><A NAME="6957"></A>
<A NAME="6958"></A>
   If the Prefer Mounted Volumes directive is set to <B>yes</B> (default
   yes), the Storage daemon is requested to select either an Autochanger or
   a drive with a valid Volume already mounted in preference to a drive
   that is not ready.  This means that all jobs will attempt to append
   to the same Volume (providing the Volume is appropriate - right Pool, 
   ... for that job), unless you are using multiple pools.
   If no drive with a suitable Volume is available, it
   will select the first available drive.  Note, any Volume that has
   been requested to be mounted, will be considered valid as a mounted
   volume by another job.  This if multiple jobs start at the same time
   and they all prefer mounted volumes, the first job will request the
   mount, and the other jobs will use the same volume.

<P>
If the directive is set to <B>no</B>, the Storage daemon will prefer
   finding an unused drive, otherwise, each job started will append to the
   same Volume (assuming the Pool is the same for all jobs).  Setting
   Prefer Mounted Volumes to no can be useful for those sites
   with multiple drive autochangers that prefer to maximize backup
   throughput at the expense of using additional drives and Volumes. 
   This means that the job will prefer to use an unused drive rather
   than use a drive that is already in use.

<P>
Despite the above, we recommend against setting this directive to
   <B>no</B> since
   it tends to add a lot of swapping of Volumes between the different
   drives and can easily lead to deadlock situations in the Storage
   daemon. We will accept bug reports against it, but we cannot guarantee
   that we will be able to fix the problem in a reasonable time.

<P>
A better alternative for using multiple drives is to use multiple
   pools so that Bacula will be forced to mount Volumes from those Pools
   on different drives.

<P>
</DD>
<DT><STRONG>Prune Jobs = yesno</STRONG></DT>
<DD><A NAME="6965"></A>
<A NAME="6966"></A>
   Normally, pruning of Jobs from the Catalog is specified on a Pool by
   Pool basis in the Pool resource with the <B>AutoPrune</B> directive.
   If this directive is specified (not normally) and the value is <B>   yes</B>, it will override the value specified in the Pool resource.  The
   default is <B>no</B>.

<P>
</DD>
<DT><STRONG>Prune Files = yesno</STRONG></DT>
<DD><A NAME="6973"></A>
<A NAME="6974"></A>
   Normally, pruning of Files from the Catalog is specified on a Pool by
   Pool basis in the Pool resource with the <B>AutoPrune</B> directive.
   If this directive is specified (not normally) and the value is <B>   yes</B>, it will override the value specified in the Pool resource.  The
   default is <B>no</B>.

<P>
</DD>
<DT><STRONG>Prune Volumes = yesno</STRONG></DT>
<DD><A NAME="6981"></A>
<A NAME="6982"></A>
   Normally, pruning of Volumes from the Catalog is specified on a Pool
   by Pool basis in the Pool resource with the <B>AutoPrune</B>
   directive.  If this directive is specified (not normally) and the value
   is <B>yes</B>, it will override the value specified in the Pool
   resource.  The default is <B>no</B>.

<P>
</DD>
<DT><STRONG>RunScript {body-of-runscript}</STRONG></DT>
<DD><A NAME="6988"></A>
   <A NAME="6989"></A>

<P>
The RunScript directive behaves like a resource in that it
   requires opening and closing braces around a number of directives
   that make up the body of the runscript.

<P>
The specified <B>Command</B> (see below for details) is run as an external
   program prior or after the current Job.  This is optional.  By default, the
   program is executed on the Client side like in <TT>ClientRunXXXJob</TT>.

<P>
<B>Console</B> options are special commands that are sent to the director instead
   of the OS. At this time, console command ouputs are redirected to log with
   the jobid 0.

<P>
You can use following console command : <TT>delete</TT>, <TT>disable</TT>,
   <TT>enable</TT>, <TT>estimate</TT>, <TT>list</TT>, <TT>llist</TT>,
   <TT>memory</TT>, <TT>prune</TT>, <TT>purge</TT>, <TT>reload</TT>,
   <TT>status</TT>, <TT>setdebug</TT>, <TT>show</TT>, <TT>time</TT>,
   <TT>trace</TT>, <TT>update</TT>, <TT>version</TT>, <TT>.client</TT>,
   <TT>.jobs</TT>, <TT>.pool</TT>, <TT>.storage</TT>.  See console chapter for
   more information. You need to specify needed information on command line, nothing
   will be prompted. Example :

<P>
<PRE>
   Console = "prune files client=%c"
   Console = "update stats age=3"
</PRE>

<P>
You can specify more than one Command/Console option per RunScript.

<P>
You can use following options may be specified in the body
   of the runscript:
<BR>
<P>
<TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER">Options</TD>
<TD ALIGN="CENTER">Value</TD>
<TD ALIGN="CENTER">Default</TD>
<TD ALIGN="LEFT">Information</TD>
</TR>
<TR><TD ALIGN="CENTER">Runs On Success</TD>
<TD ALIGN="CENTER">Yes/No</TD>
<TD ALIGN="CENTER"><I>Yes</I></TD>
<TD ALIGN="LEFT">Run command if JobStatus is successful</TD>
</TR>
<TR><TD ALIGN="CENTER">Runs On Failure</TD>
<TD ALIGN="CENTER">Yes/No</TD>
<TD ALIGN="CENTER"><I>No</I></TD>
<TD ALIGN="LEFT">Run command if JobStatus isn't successful</TD>
</TR>
<TR><TD ALIGN="CENTER">Runs On Client</TD>
<TD ALIGN="CENTER">Yes/No</TD>
<TD ALIGN="CENTER"><I>Yes</I></TD>
<TD ALIGN="LEFT">Run command on client</TD>
</TR>
<TR><TD ALIGN="CENTER">Runs When</TD>
<TD ALIGN="CENTER">Before|After|Always|<I>AfterVSS</I></TD>
<TD ALIGN="CENTER"><I>Never</I></TD>
<TD ALIGN="LEFT">When run commands</TD>
</TR>
<TR><TD ALIGN="CENTER">Fail Job On Error</TD>
<TD ALIGN="CENTER">Yes/No</TD>
<TD ALIGN="CENTER"><I>Yes</I></TD>
<TD ALIGN="LEFT">Fail job if script returns 
                                          something different from 0</TD>
</TR>
<TR><TD ALIGN="CENTER">Command</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="LEFT">Path to your script</TD>
</TR>
<TR><TD ALIGN="CENTER">Console</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="LEFT">Console command</TD>
</TR>
</TABLE>
   
<BR>
<P>
Any output sent by the command to standard output will be included in the
   Bacula job report.  The command string must be a valid program name or name
   of a shell script.

<P>
In addition, the command string is parsed then fed to the OS,
   which means that the path will be searched to execute your specified
   command, but there is no shell interpretation, as a consequence, if you
   invoke complicated commands or want any shell features such as redirection
   or piping, you must call a shell script and do it inside that script.

<P>
Before submitting the specified command to the operating system, Bacula
   performs character substitution of the following characters:

<P>
<A NAME="character_substitution"></A><PRE>
    %% = %
    %c = Client's name
    %d = Director's name
    %e = Job Exit Status
    %i = JobId
    %j = Unique Job id
    %l = Job Level
    %n = Job name
    %s = Since time
    %t = Job type (Backup, ...)
    %v = Volume name (Only on director side)
 </PRE>
<P>
The Job Exit Status code %e edits the following values:

<P>
<A NAME="7028"></A>

<UL>
<LI>OK
</LI>
<LI>Error
</LI>
<LI>Fatal Error
</LI>
<LI>Canceled
</LI>
<LI>Differences
</LI>
<LI>Unknown term code
</LI>
</UL>

<P>
Thus if you edit it on a command line, you will need to enclose 
   it within some sort of quotes.

<P>
You can use these following shortcuts:
<BR>
<P>
<TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER">Keyword</TD>
<TD ALIGN="CENTER">RunsOnSuccess</TD>
<TD ALIGN="CENTER">RunsOnFailure</TD>
<TD ALIGN="CENTER">FailJobOnError</TD>
<TD ALIGN="CENTER">Runs On Client</TD>
<TD ALIGN="CENTER">RunsWhen</TD>
</TR>
<TR><TD ALIGN="CENTER">Run Before Job</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">Yes</TD>
<TD ALIGN="CENTER">No</TD>
<TD ALIGN="CENTER">Before</TD>
</TR>
<TR><TD ALIGN="CENTER">Run After Job</TD>
<TD ALIGN="CENTER">Yes</TD>
<TD ALIGN="CENTER">No</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">No</TD>
<TD ALIGN="CENTER">After</TD>
</TR>
<TR><TD ALIGN="CENTER">Run After Failed Job</TD>
<TD ALIGN="CENTER">No</TD>
<TD ALIGN="CENTER">Yes</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">No</TD>
<TD ALIGN="CENTER">After</TD>
</TR>
<TR><TD ALIGN="CENTER">Client Run Before Job</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">Yes</TD>
<TD ALIGN="CENTER">Yes</TD>
<TD ALIGN="CENTER">Before</TD>
</TR>
<TR><TD ALIGN="CENTER">Client Run After Job</TD>
<TD ALIGN="CENTER">Yes</TD>
<TD ALIGN="CENTER">No</TD>
<TD ALIGN="CENTER">&nbsp;</TD>
<TD ALIGN="CENTER">Yes</TD>
<TD ALIGN="CENTER">After</TD>
</TR>
</TABLE>

<P>
Examples:
<PRE>
RunScript {
    RunsWhen = Before
    FailJobOnError = No
    Command = "/etc/init.d/apache stop"
}

RunScript {
    RunsWhen = After
    RunsOnFailure = yes
    Command = "/etc/init.d/apache start"
}
</PRE>

<P>
<B>Notes about ClientRunBeforeJob</B>

<P>
For compatibility reasons, with this shortcut, the command is executed
   directly when the client recieve it. And if the command is in error, other
   remote runscripts will be discarded. To be sure that all commands will be
   sent and executed, you have to use RunScript syntax.

<P>
<B>Special Windows Considerations</B>

<P>
You can run scripts just after snapshots initializations with
   <I>AfterVSS</I> keyword.

<P>
In addition, for a Windows client on version 1.33 and above, please take
   note that you must ensure a correct path to your script.  The script or
   program can be a .com, .exe or a .bat file.  If you just put the program
   name in then Bacula will search using the same rules that cmd.exe uses
   (current directory, Bacula bin directory, and PATH).  It will even try the
   different extensions in the same order as cmd.exe.
   The command can be anything that cmd.exe or command.com will recognize
   as an executable file.  

<P>
However, if you have slashes in the program name then Bacula figures you
   are fully specifying the name, so you must also explicitly add the three
   character extension.

<P>
The command is run in a Win32 environment, so Unix like commands will not
   work unless you have installed and properly configured Cygwin in addition
   to and separately from Bacula.

<P>
The System %Path% will be searched for the command.  (under the
   environment variable dialog you have have both System Environment and
   User Environment, we believe that only the System environment will be
   available to bacula-fd, if it is running as a service.)

<P>
System environment variables can be referenced with %var% and
   used as either part of the command name or arguments.  

<P>
So if you have a script in the Bacula
<BR>
bin directory then the following lines
   should work fine:

<P>
<PRE>
        Client Run Before Job = systemstate
or
        Client Run Before Job = systemstate.bat
or
        Client Run Before Job = "systemstate"
or
        Client Run Before Job = "systemstate.bat"
or
        ClientRunBeforeJob = "\"C:/Program Files/Bacula/systemstate.bat\""
</PRE>
<P>
The outer set of quotes is removed when the configuration file is parsed.
You need to escape the inner quotes so that they are there when the code
that parses the command line for execution runs so it can tell what the
program name is.

<P>
<PRE>
ClientRunBeforeJob = "\"C:/Program Files/Software
     Vendor/Executable\" /arg1 /arg2 \"foo bar\""
</PRE>
<P>
The special characters 
<PRE>
&amp;&lt;&gt;()@^|
</PRE>
   will need to be quoted,
   if they are part of a filename or argument.

<P>
If someone is logged in, a blank "command" window running the commands
   will be present during the execution of the command.

<P>
Some Suggestions from Phil Stracchino for running on Win32 machines with
   the native Win32 File daemon:

<P>

<OL>
<LI>You might want the ClientRunBeforeJob directive to specify a .bat
      file which runs the actual client-side commands, rather than trying
      to run (for example) regedit /e directly.
</LI>
<LI>The batch file should explicitly 'exit 0' on successful completion.  
</LI>
<LI>The path to the batch file should be specified in Unix form:  

<P>
ClientRunBeforeJob = "c:/bacula/bin/systemstate.bat"  

<P>
rather than DOS/Windows form:  

<P>
ClientRunBeforeJob =

<P>
"c:&#92;bacula&#92;bin&#92;systemstate.bat"
   INCORRECT 
   
</LI>
</OL>

<P>
For Win32, please note that there are certain limitations:  

<P>
ClientRunBeforeJob = "C:/Program Files/Bacula/bin/pre-exec.bat"

<P>
Lines like the above do not work because there are limitations of
cmd.exe that is used to execute the command.
Bacula prefixes the string you supply with <B>cmd.exe /c </B>.  To test that
your command works you should type <B>cmd /c "C:/Program Files/test.exe"</B> at a
cmd prompt and see what happens.  Once the command is correct insert a
backslash (&#92;) before each double quote ("), and
then put quotes around the whole thing when putting it in
the director's .conf file.  You either need to have only one set of quotes
or else use the short name and don't put quotes around the command path.

<P>
Below is the output from cmd's help as it relates to the command line
passed to the /c option.

<P>
If /C or /K is specified, then the remainder of the command line after
 the switch is processed as a command line, where the following logic is
 used to process quote (") characters:

<P>

<OL>
<LI>If all of the following conditions are met, then quote characters
         on the command line are preserved:
    
<UL>
<LI>no /S switch.
</LI>
<LI>exactly two quote characters.
</LI>
<LI>no special characters between the two quote characters,
           where special is one of: 
<PRE>
&amp;&lt;&gt;()@^|
</PRE>
</LI>
<LI>there are one or more whitespace characters between the
           the two quote characters.
</LI>
<LI>the string between the two quote characters is the name
           of an executable file.
    
</LI>
</UL>

<P>
</LI>
<LI>Otherwise, old behavior is to see if the first character is
         a quote character and if so, strip the leading character and
         remove the last quote character on the command line, preserving
         any text after the last quote character. 

<P>
</LI>
</OL>

<P>
The following example of the use of the Client Run Before Job directive was 
submitted by a user:
<BR>
You could write a shell script to back up a DB2 database to a FIFO. The shell
script is:

<P>
<PRE>
 #!/bin/sh
 # ===== backupdb.sh
 DIR=/u01/mercuryd
 
 mkfifo $DIR/dbpipe
 db2 BACKUP DATABASE mercuryd TO $DIR/dbpipe WITHOUT PROMPTING &amp;
 sleep 1
</PRE>
<P>
The following line in the Job resource in the bacula-dir.conf file:
<PRE>
 Client Run Before Job = "su - mercuryd -c \"/u01/mercuryd/backupdb.sh '%t'
'%l'\""
</PRE>
<P>
When the job is run, you will get messages from the output of the script
stating that the backup has started. Even though the command being run is
backgrounded with &amp;, the job will block until the "db2 BACKUP DATABASE"
command, thus the backup stalls.

<P>
To remedy this situation, the "db2 BACKUP DATABASE" line should be changed to
the following:

<P>
<PRE> 
 db2 BACKUP DATABASE mercuryd TO $DIR/dbpipe WITHOUT PROMPTING &gt; $DIR/backup.log
2&gt;&amp;1 &lt; /dev/null &amp;
</PRE>
<P>
It is important to redirect the input and outputs of a backgrounded command to
/dev/null to prevent the script from blocking.

<P>
</DD>
<DT><STRONG>Run Before Job = command</STRONG></DT>
<DD><A NAME="7067"></A>
<A NAME="7068"></A>
<A NAME="7069"></A>
The specified <B>command</B> is run as an external program prior to running the
current Job.  This directive is not required, but if it is defined, and if the
exit code of the program run is non-zero, the current Bacula job will be
canceled.

<P>
<PRE>
Run Before Job = "echo test"
</PRE>
   it's equivalent to :
<PRE>
RunScript {
 Command = "echo test"
 RunsOnClient = No
 RunsWhen = Before
}
</PRE> 

<P>
Lutz Kittler has pointed out that using the RunBeforeJob directive 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 inserted on Wednesday
   before leaving will be used.

<P>
</DD>
<DT><STRONG>Run After Job = command</STRONG></DT>
<DD><A NAME="7077"></A>
<A NAME="7078"></A>
   The specified <B>command</B> is run as an external program if the current
   job terminates normally (without error or without being canceled).  This
   directive is not required.  If the exit code of the program run is
   non-zero, Bacula will print a warning message.  Before submitting the
   specified command to the operating system, Bacula performs character
   substitution as described above for the <B>RunScript</B> directive.

<P>
An example of the use of this directive is given in the  
   Tips ChapterJobNotification of this manual.  

<P>
See the <B>Run After Failed Job</B> if you
   want to run a script after the job has terminated with any
   non-normal status.

<P>
</DD>
<DT><STRONG>Run After Failed Job = command</STRONG></DT>
<DD><A NAME="7086"></A>
<A NAME="7087"></A>
   The specified <B>command</B> is run as an external program after the current
   job terminates with any error status.  This directive 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, Bacula will print a
   warning message. Before submitting the specified command to the
   operating system, Bacula performs character substitution as described above
   for the <B>RunScript</B> directive. Note, if you wish that your script
   will run regardless of the exit status of the Job, you can use this :
<PRE>
RunScript {
 Command = "echo test"
 RunsWhen = After
 RunsOnFailure = yes
 RunsOnClient  = no
 RunsOnSuccess = yes    # default, you can drop this line
}
</PRE>

<P>
An example of the use of this directive is given in the  
   Tips ChapterJobNotification of this manual.

<P>
</DD>
<DT><STRONG>Client Run Before Job = command</STRONG></DT>
<DD><A NAME="7096"></A>
<A NAME="7097"></A>
   This directive is the same as <B>Run Before Job</B> except that the
   program is run on the client machine.  The same restrictions apply to
   Unix systems as noted above for the <B>RunScript</B>.

<P>
</DD>
<DT><STRONG>Client Run After Job = command</STRONG></DT>
<DD><A NAME="7102"></A>
   <A NAME="7103"></A>
   The specified <B>command</B> is run on the client machine as soon
   as data spooling is complete in order to allow restarting applications
   on the client as soon as possible. .

<P>
Note, please see the notes above in <B>RunScript</B> 
   concerning Windows clients.

<P>
</DD>
<DT><STRONG>Rerun Failed Levels = yesno</STRONG></DT>
<DD><A NAME="7109"></A>
   <A NAME="7110"></A>
   If this directive is set to <B>yes</B> (default no), and Bacula detects that
   a previous job at a higher level (i.e.  Full or Differential) has failed,
   the current job level will be upgraded to the higher level.  This is
   particularly useful for Laptops where they may often be unreachable, and if
   a prior Full save has failed, you wish the very next backup to be a Full
   save rather than whatever level it is started as.

<P>
There are several points that must be taken into account when using this
   directive: first, a failed job is defined as one that has not terminated
   normally, which includes any running job of the same name (you need to
   ensure that two jobs of the same name do not run simultaneously);
   secondly, the <B>Ignore FileSet Changes</B> directive is not considered 
   when checking for failed levels, which means that any FileSet change will
   trigger a rerun.

<P>
</DD>
<DT><STRONG>Spool Data = yesno</STRONG></DT>
<DD><A NAME="7116"></A>
   <A NAME="7117"></A>

<P>
If this directive is set  to <B>yes</B> (default no), the Storage daemon will
   be requested  to spool the data for this Job to disk rather than write it 
   directly to tape. Once all the data arrives or the spool files' maximum sizes
   are reached, the data will be despooled and written  to tape. Spooling data 
   prevents tape  shoe-shine (start and stop) during
   Incremental saves. If you are writing to a disk file using this option
   will probably just slow down the backup jobs.

<P>
NOTE: When this directive is set to yes, Spool Attributes is also
   automatically set to yes.

<P>
</DD>
<DT><STRONG>Spool Attributes = yesno</STRONG></DT>
<DD><A NAME="7122"></A>
   <A NAME="7123"></A>
   <A NAME="7124"></A>
   <A NAME="7125"></A>
   <A NAME="7126"></A>
   <A NAME="7127"></A>
   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.

<P>
NOTE: When Spool Data is set to yes, Spool Attributes is also
   automatically set to yes.

<P>
</DD>
<DT><STRONG>Where = directory</STRONG></DT>
<DD><A NAME="7132"></A>
   <A NAME="7133"></A>
   This directive 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.

<P>
</DD>
<DT><STRONG>Add Prefix = directory</STRONG></DT>
<DD><A NAME="confaddprefix"></A>  <A NAME="7141"></A>
  <A NAME="7142"></A>
  This directive applies only to a Restore job and specifies a prefix to the
  directory name of all files being restored.  This will use File
  Relocationfilerelocation feature implemented in Bacula 2.1.8 or later.  

<P>
</DD>
<DT><STRONG>Add Suffix = extention</STRONG></DT>
<DD><A NAME="7147"></A>
  <A NAME="7148"></A>
  This directive applies only to a Restore job and specifies a suffix to all
  files being restored.  This will use File Relocationfilerelocation
  feature implemented in Bacula 2.1.8 or later.

<P>
Using <TT>Add Suffix=.old</TT>, <TT>/etc/passwd</TT> will be restored to
  <TT>/etc/passwsd.old</TT>

<P>
</DD>
<DT><STRONG>Strip Prefix = directory</STRONG></DT>
<DD><A NAME="7156"></A>
  <A NAME="7157"></A>
  This directive applies only to a Restore job and specifies a prefix to remove
  from the directory name of all files being restored.  This will use the
  File Relocationfilerelocation feature implemented in Bacula 2.1.8 
  or later.

<P>
Using <TT>Strip Prefix=/etc</TT>, <TT>/etc/passwd</TT> will be restored to
  <TT>/passwd</TT>

<P>
Under Windows, if you want to restore <TT>c:/files</TT> to <TT>d:/files</TT>,
  you can use :

<P>
<PRE>
 Strip Prefix = c:
 Add Prefix = d:
</PRE>

<P>
</DD>
<DT><STRONG>RegexWhere = expressions</STRONG></DT>
<DD><A NAME="7169"></A>
  <A NAME="7170"></A>
  This directive applies only to a Restore job and specifies a regex filename
  manipulation of all files being restored.  This will use File
  Relocationfilerelocation feature implemented in Bacula 2.1.8 or later.

<P>
For more informations about how use this option, see
  thisuseregexwhere.

<P>
</DD>
<DT><STRONG>Replace = replace-option</STRONG></DT>
<DD><A NAME="7177"></A>
   <A NAME="7178"></A>
   This directive applies only to a Restore job and specifies what happens
   when Bacula wants to restore a file or directory that already exists.
   You have the following options for <B>replace-option</B>:

<P>
<DL>
<DT><STRONG>always</STRONG></DT>
<DD><A NAME="7181"></A>
  when the file to be restored already exists, it is deleted and then
  replaced by the copy that was backed up.  This is the default value.

<P>
</DD>
<DT><STRONG>ifnewer</STRONG></DT>
<DD><A NAME="7182"></A>
  if the backed up file (on tape) is newer than the existing file, the
  existing file is deleted and replaced by the back up.

<P>
</DD>
<DT><STRONG>ifolder</STRONG></DT>
<DD><A NAME="7183"></A>
  if the backed up file (on tape) is older than the existing file, the
  existing file is deleted and replaced by the back up.

<P>
</DD>
<DT><STRONG>never</STRONG></DT>
<DD><A NAME="7184"></A>
  if the backed up file already exists, Bacula skips  restoring this file.  
</DD>
</DL>

<P>
</DD>
<DT><STRONG>Prefix Links=yesno</STRONG></DT>
<DD><A NAME="7189"></A>
   <A NAME="7190"></A>
   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> then while restoring 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.

<P>
</DD>
<DT><STRONG>Maximum Concurrent Jobs = number</STRONG></DT>
<DD><A NAME="7196"></A>
   <A NAME="7197"></A>
   where number is the maximum number of Jobs from the current
   Job resource that can run concurrently.  Note, this directive 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  Maximum Concurrent JobsDirMaxConJobs in the
   Director's resource.

<P>
</DD>
<DT><STRONG>Reschedule On Error = yesno</STRONG></DT>
<DD><A NAME="7205"></A>
   <A NAME="7206"></A>
   If this directive is enabled, and the job terminates in error, the job
   will be rescheduled as determined by the <B>Reschedule Interval</B> and
   <B>Reschedule Times</B> directives.  If you cancel the job, it will not
   be rescheduled.  The default is <B>no</B> (i.e.  the job will not be
   rescheduled).

<P>
This specification can be useful for portables, laptops, or other
   machines that are not always connected to the network or switched on.

<P>
</DD>
<DT><STRONG>Reschedule Interval = time-specification</STRONG></DT>
<DD><A NAME="7212"></A>
   <A NAME="7213"></A>
   If you have specified <B>Reschedule On Error = yes</B> and the job
   terminates in error, it will be rescheduled after the interval of time
   specified by <B>time-specification</B>.  See the time
   specification formatsTime in the Configure chapter for details of
   time specifications.  If no interval is specified, the job will not be
   rescheduled on error.

<P>
</DD>
<DT><STRONG>Reschedule Times = count</STRONG></DT>
<DD><A NAME="7220"></A>
   <A NAME="7221"></A>
   This directive specifies the maximum number of times to reschedule the
   job.  If it is set to zero (the default) the job will be rescheduled an
   indefinite number of times.

<P>
</DD>
<DT><STRONG>Allow Duplicate Jobs = yesno</STRONG></DT>
<DD><A NAME="7225"></A>

<P>

<DIV ALIGN="CENTER"><A NAME="fig:allowduplicatejobs"></A><A NAME="7228"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 17.2:</STRONG>
Allow Duplicate Jobs usage</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER">  <IMG
 WIDTH="585" HEIGHT="592" ALIGN="BOTTOM" BORDER="0"
 SRC="img21.png"
 ALT="\includegraphics[width=13cm]{duplicate-real.eps}">
  </DIV></TD></TR>
</TABLE>
</DIV>

<P>
A duplicate job in the sense we use it here means a second or subsequent job
with the same name starts.  This happens most frequently when the first job
runs longer than expected because no tapes are available.

<P>
If this directive is enabled duplicate jobs will be run.  If
  the directive is set to <B>no</B> (default) then only one job of a given name
  may run at one time, and the action that Bacula takes to ensure only
  one job runs is determined by the other directives (see below).

<P>
If <B>Allow Duplicate Jobs</B> is set to <B>no</B> and two jobs
  are present and none of the three directives given below permit
  cancelling a job, then the current job (the second one started)
  will be cancelled.

<P>
</DD>
<DT><STRONG>Allow Higher Duplicates = yesno</STRONG></DT>
<DD><A NAME="7237"></A>
  This directive was implemented in version 5.0.0, but does not work
  as expected. If used, it should always be set to no.  In later versions
  of Bacula the directive is disabled (disregarded).

<P>
</DD>
<DT><STRONG>Cancel Lower Level Duplicates = yesno</STRONG></DT>
<DD><A NAME="7241"></A>
  If <B>Allow Duplicates Jobs</B> is set to <B>no</B> and this
  directive is set to <B>yes</B>, Bacula will choose between duplicated
  jobs the one with the highest level.  For example, it will cancel a
  previous Incremental to run a Full backup.  It works only for Backup
  jobs.  The default is <TT>no</TT>. If the levels of the duplicated
  jobs are the same, nothing is done and the other
  Cancel XXX Duplicate directives will be examined.

<P>
</DD>
<DT><STRONG>Cancel Queued Duplicates = yesno</STRONG></DT>
<DD><A NAME="7249"></A>
  If <B>Allow Duplicate Jobs</B> is set to <B>no</B> and
  if this directive is set to <B>yes</B> any job that is
  already queued to run but not yet running will be canceled.
  The default is <B>no</B>. 

<P>
</DD>
<DT><STRONG>Cancel Running Duplicates = yesno</STRONG></DT>
<DD><A NAME="7257"></A>
  If <B>Allow Duplicate Jobs</B> is set to <B>no</B> and
  if this directive is set to <B>yes</B> any job that is already running
  will be canceled.  The default is <B>no</B>.

<P>
</DD>
<DT><STRONG>DuplicateJobProximity = time-specification</STRONG></DT>
<DD><A NAME="7264"></A>
  This directive permits to determine if two jobs are really duplicated.
  If the first one is running for long time, this is probably not a good
  idea to cancel it.

<P>
</DD>
<DT><STRONG>Run = job-name</STRONG></DT>
<DD><A NAME="7267"></A>
   <A NAME="7268"></A>
   <A NAME="7269"></A>
   The Run directive (not to be confused with the Run option in a 
   Schedule) allows you to start other jobs or to clone jobs. By using the
   cloning keywords (see below), you can backup
   the same data (or almost the same data) to two or more drives
   at the same time. The <B>job-name</B> is normally the same name
   as the current Job resource (thus creating a clone). However, it
   may be any Job name, so one job may start other related jobs.

<P>
The part after the equal sign must be enclosed in double quotes,
   and can contain any string or set of options (overrides) that you
   can specify when entering the Run command from the console. For
   example <B>storage=DDS-4 ...</B>.  In addition, there are two special
   keywords that permit you to clone the current job. They are <B>level=%l</B>
   and <B>since=%s</B>. The %l in the level keyword permits 
   entering the actual level of the current job and the %s in the since
   keyword permits putting the same time for comparison as used on the
   current job.  Note, in the case of the since keyword, the %s must be
   enclosed in double quotes, and thus they must be preceded by a backslash
   since they are already inside quotes. For example:

<P>
<PRE>
   run = "Nightly-backup level=%l since=\"%s\" storage=DDS-4"
</PRE>

<P>
A cloned job will not start additional clones, so it is not
   possible to recurse.

<P>
Please note that all cloned jobs, as specified in the Run directives are
   submitted for running before the original job is run (while it is being
   initialized). This means that any clone job will actually start before
   the original job, and may even block the original job from starting
   until the original job finishes unless you allow multiple simultaneous
   jobs.  Even if you set a lower priority on the clone job, if no other
   jobs are running, it will start before the original job.

<P>
If you are trying to prioritize jobs by using the clone feature (Run
   directive), you will find it much easier to do using a RunScript
   resource, or a RunBeforeJob directive.

<P>
<A NAME="Priority"></A></DD>
<DT><STRONG>Priority = number</STRONG></DT>
<DD><A NAME="7279"></A>
   <A NAME="7280"></A>
   This directive permits you to control the order in which your jobs will
   be run by specifying a positive non-zero number. The higher the number,
   the lower the job priority. Assuming you are not running concurrent jobs,
   all queued jobs of priority 1 will run before queued jobs of priority 2
   and so on, regardless of the original scheduling order.

<P>
The priority only affects waiting jobs that are queued to run, not jobs
   that are already running.  If one or more jobs of priority 2 are already
   running, and a new job is scheduled with priority 1, the currently
   running priority 2 jobs must complete before the priority 1 job is
   run, unless Allow Mixed Priority is set.

<P>
The default priority is 10.  

<P>
If you want to run concurrent jobs you should
   keep these points in mind:

<P>

<UL>
<LI>See Running Concurrent JobsConcurrentJobs on how to setup
   concurrent jobs.

<P>
</LI>
<LI>Bacula concurrently runs jobs of only one priority at a time.  It
   will not simultaneously run a priority 1 and a priority 2 job.

<P>
</LI>
<LI>If Bacula is running a priority 2 job and a new priority 1 job is
   scheduled, it will wait until the running priority 2 job terminates even
   if the Maximum Concurrent Jobs settings would otherwise allow two jobs
   to run simultaneously.

<P>
</LI>
<LI>Suppose that bacula is running a priority 2 job and a new priority 1
   job is scheduled and queued waiting for the running priority 2 job to
   terminate.  If you then start a second priority 2 job, the waiting
   priority 1 job will prevent the new priority 2 job from running
   concurrently with the running priority 2 job.  That is: as long as there
   is a higher priority job waiting to run, no new lower priority jobs will
   start even if the Maximum Concurrent Jobs settings would normally allow
   them to run.  This ensures that higher priority jobs will be run as soon
   as possible.
</LI>
</UL>

<P>
If you have several jobs of different priority, it may not best to start
them at exactly the same time, because Bacula must examine them one at a
time.  If by Bacula starts a lower priority job first, then it will run
before your high priority jobs.  If you experience this problem, you may
avoid it by starting any higher priority jobs a few seconds before lower
priority ones.  This insures that Bacula will examine the jobs in the
correct order, and that your priority scheme will be respected.

<P>
<A NAME="AllowMixedPriority"></A></DD>
<DT><STRONG>Allow Mixed Priority = yesno</STRONG></DT>
<DD><A NAME="7289"></A>
   This directive is only implemented in version 2.5 and later.  When
   set to <B>yes</B> (default <B>no</B>), this job may run even if lower
   priority jobs are already running.  This means a high priority job
   will not have to wait for other jobs to finish before starting.
   The scheduler will only mix priorities when all running jobs have
   this set to true.

<P>
Note that only higher priority jobs will start early.  Suppose the
   director will allow two concurrent jobs, and that two jobs with
   priority 10 are running, with two more in the queue.  If a job with
   priority 5 is added to the queue, it will be run as soon as one of
   the running jobs finishes.  However, new priority 10 jobs will not
   be run until the priority 5 job has finished.

<P>
<A NAME="WritePartAfterJob"></A></DD>
<DT><STRONG>Write Part After Job = yesno</STRONG></DT>
<DD><A NAME="7296"></A>
<A NAME="7297"></A>
   This directive is only implemented in version 1.37 and later.
   If this directive is set to <B>yes</B> (default <B>no</B>), a new part file
   will be created after the job is finished.  

<P>
It should be set to <B>yes</B> when writing to devices that require mount
   (for example DVD), so you are sure that the current part, containing
   this job's data, is written to the device, and that no data is left in
   the temporary file on the hard disk.  However, on some media, like DVD+R
   and DVD-R, a lot of space (about 10Mb) is lost every time a part is
   written.  So, if you run several jobs each after another, you could set
   this directive to <B>no</B> for all jobs, except the last one, to avoid
   wasting too much space, but to ensure that the data is written to the
   medium when all jobs are finished.

<P>
This directive is ignored with tape and FIFO devices.  

<P>
</DD>
</DL>

<P>
The following is an example of a valid Job resource definition: 

<P>
<PRE>
Job {
  Name = "Minou"
  Type = Backup
  Level = Incremental                 # default
  Client = Minou
  FileSet="Minou Full Set"
  Storage = DLTDrive
  Pool = Default
  Schedule = "MinouWeeklyCycle"
  Messages = Standard
}
</PRE>
<P>

<H1><A NAME="SECTION001840000000000000000"></A>
<A NAME="JobDefsResource"></A>
<BR>
The JobDefs Resource
</H1>
<A NAME="7307"></A>
<A NAME="7308"></A>

<P>
The JobDefs resource permits all the same directives that can appear in a Job
resource. However, a JobDefs resource does not create a Job, rather it can be
referenced within a Job to provide defaults for that Job. This permits you to
concisely define several nearly identical Jobs, each one referencing a JobDefs
resource which contains the defaults. Only the changes from the defaults need to
be mentioned in each Job. 

<P>

<H1><A NAME="SECTION001850000000000000000"></A>
<A NAME="ScheduleResource"></A>
<BR>
The Schedule Resource
</H1>
<A NAME="7311"></A>
<A NAME="7312"></A>

<P>
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. If a Schedule resource is not referenced in a Job, the Job can only
be run manually. In general, you specify an action to be taken and when. 

<P>
<DL>
<DT><STRONG>Schedule</STRONG></DT>
<DD><A NAME="7314"></A>
<A NAME="7315"></A>
   Start of the Schedule directives.  No <B>Schedule</B> resource is
   required, but you will need at least one if you want Jobs to be
   automatically started.

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="7319"></A>
   <A NAME="7320"></A>
   The name of the schedule being defined.  The Name directive is required. 

<P>
</DD>
<DT><STRONG>Run = Job-overrides Date-time-specification</STRONG></DT>
<DD><A NAME="7325"></A>
   <A NAME="7326"></A>
   The Run directive defines when a Job is to be run, and what overrides if
   any to apply.  You may specify multiple <B>run</B> directives 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> directives that start at
   the same time, two Jobs will start at the same time (well, within one
   second of each other).

<P>
The <B>Job-overrides</B> permit overriding the Level, the Storage, the
   Messages, and the Pool specifications provided in the Job resource.  In
   addition, the FullPool, the IncrementalPool, and the DifferentialPool
   specifications permit overriding the Pool specification according to
   what backup Job Level is in effect.

<P>
By the use of overrides, you may customize a particular Job.  For
   example, you may specify a Messages override for your Incremental
   backups that outputs messages to a log file, but for your weekly or
   monthly Full backups, you may send the output by email by using a
   different Messages override.

<P>
<B>Job-overrides</B> are specified as: <B>keyword=value</B> where the
   keyword is Level, Storage, Messages, Pool, FullPool, DifferentialPool,
   or IncrementalPool, and the <B>value</B> is as defined on the respective
   directive formats for the Job resource.  You may specify multiple <B>   Job-overrides</B> on one <B>Run</B> directive by separating them with one or
   more spaces or by separating them with a trailing comma.  For example:

<P>
<DL>
<DT><STRONG>Level=Full</STRONG></DT>
<DD><A NAME="7337"></A>
   <A NAME="7338"></A>
   is all files in the FileSet whether or not  they have changed.  

<P>
</DD>
<DT><STRONG>Level=Incremental</STRONG></DT>
<DD><A NAME="7339"></A>
   <A NAME="7340"></A>
   is all files that have changed since  the last backup.  

<P>
</DD>
<DT><STRONG>Pool=Weekly</STRONG></DT>
<DD><A NAME="7341"></A>
   <A NAME="7342"></A>
   specifies to use the Pool named <B>Weekly</B>.  

<P>
</DD>
<DT><STRONG>Storage=DLT_Drive</STRONG></DT>
<DD><A NAME="7344"></A>
   <A NAME="7345"></A>
   specifies to use <B>DLT_Drive</B> for  the storage device.  

<P>
</DD>
<DT><STRONG>Messages=Verbose</STRONG></DT>
<DD><A NAME="7347"></A>
   <A NAME="7348"></A>
   specifies to use the <B>Verbose</B>  message resource for the Job.  

<P>
</DD>
<DT><STRONG>FullPool=Full</STRONG></DT>
<DD><A NAME="7350"></A>
   <A NAME="7351"></A>
   specifies to use the Pool named <B>Full</B>  if the job is a full backup, or
is
upgraded from another type  to a full backup.  

<P>
</DD>
<DT><STRONG>DifferentialPool=Differential</STRONG></DT>
<DD><A NAME="7353"></A>
   <A NAME="7354"></A>
   specifies to use the Pool named <B>Differential</B> if the job is a
   differential  backup.  

<P>
</DD>
<DT><STRONG>IncrementalPool=Incremental</STRONG></DT>
<DD><A NAME="7356"></A>
   <A NAME="7357"></A>
   specifies to use the Pool  named <B>Incremental</B> if the job is an
incremental  backup.  

<P>
</DD>
<DT><STRONG>SpoolData=yesno</STRONG></DT>
<DD><A NAME="7360"></A>
   <A NAME="7361"></A>
   tells Bacula to request the Storage  daemon to spool data to a disk file
   before writing it to the Volume (normally a tape). Thus the data is
   written in large blocks to the Volume rather than small blocks. This
   directive is particularly useful when running multiple simultaneous
   backups to tape. It prevents interleaving of the job data and reduces
   or eliminates tape drive stop and start commonly known as "shoe-shine".

<P>
</DD>
<DT><STRONG>SpoolSize=<I>bytes</I></STRONG></DT>
<DD><A NAME="7363"></A>
   <A NAME="7364"></A>
   where the bytes specify the maximum spool size for this job.
   The default is take from Device Maximum Spool Size limit. 
   This directive is available only in Bacula version 2.3.5 or 
   later.

<P>
</DD>
<DT><STRONG>WritePartAfterJob=yesno</STRONG></DT>
<DD><A NAME="7366"></A>
   <A NAME="7367"></A>
   tells Bacula to request the Storage daemon to write the current part
   file to the device when the job is finished (see Write Part After
   Job directive in the Job resourceWritePartAfterJob).  Please note,
   this directive is implemented only in version 1.37 and later.  The
   default is yes.  We strongly recommend that you keep this set to yes
   otherwise, when the last job has finished one part will remain in the
   spool file and restore may or may not work.

<P>
</DD>
</DL>

<P>
<B>Date-time-specification</B> determines when the  Job is to be run. The
specification is a repetition, and as  a default Bacula is set to run a job at
the beginning of the  hour of every hour of every day of every week of every
month  of every year. This is not normally what you want, so you  must specify
or limit when you want the job to run. Any  specification given is assumed to
be repetitive in nature and  will serve to override or limit the default
repetition. This  is done by specifying masks or times for the hour, day of the
month, day of the week, week of the month, week of the year,  and month when
you want the job to run. By specifying one or  more of the above, you can
define a schedule to repeat at  almost any frequency you want.  

<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>
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>
Note, by default with no other specification, your job will run  at the
beginning of every hour. If you wish your job to run more than  once in any
given hour, you will need to specify multiple <B>run</B>  specifications each
with a different minute.  

<P>
The date/time to run the Job can be specified in the following way  in
pseudo-BNF:  

<P>
<PRE>
&lt;void-keyword&gt;    = on
&lt;at-keyword&gt;      = at
&lt;week-keyword&gt;    = 1st | 2nd | 3rd | 4th | 5th | first |
                    second | third | fourth | fifth
&lt;wday-keyword&gt;    = sun | mon | tue | wed | thu | fri | sat |
                    sunday | monday | tuesday | wednesday |
                    thursday | friday | saturday
&lt;week-of-year-keyword&gt; = w00 | w01 | ... w52 | w53
&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&gt; | &lt;wday-range&gt; |
                    &lt;week-keyword&gt; &lt;wday-keyword&gt; |
                    &lt;week-keyword&gt; &lt;wday-range&gt; |
                    &lt;daily-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>
<P>
</DD>
</DL>

<P>
Note, the Week of Year specification wnn follows the ISO standard definition
of the week of the year, where Week 1 is the week in which the first Thursday
of the year occurs, or alternatively, the week which contains the 4th of
January. Weeks are numbered w01 to w53. w00 for Bacula is the week that
precedes the first ISO week (i.e. has the first few days of the year if any
occur before Thursday). w00 is not defined by the ISO specification. A week
starts with Monday and ends with Sunday. 

<P>
According to the NIST (US National Institute of Standards and Technology),
12am and 12pm are ambiguous and can be defined to anything.  However,
12:01am is the same as 00:01 and 12:01pm is the same as 12:01, so Bacula
defines 12am as 00:00 (midnight) and 12pm as 12:00 (noon).  You can avoid
this abiguity (confusion) by using 24 hour time specifications (i.e.  no
am/pm). This is the definition in Bacula version 2.0.3 and later.

<P>
An example schedule resource that is named <B>WeeklyCycle</B> and runs a job
with level full each Sunday at 2:05am and an incremental job Monday through
Saturday at 2:05am is: 

<P>
<PRE>
Schedule {
  Name = "WeeklyCycle"
  Run = Level=Full sun at 2:05
  Run = Level=Incremental mon-sat at 2:05
}
</PRE>
<P>
An example of a possible monthly cycle is as follows: 

<P>
<PRE>
Schedule {
  Name = "MonthlyCycle"
  Run = Level=Full Pool=Monthly 1st sun at 2:05
  Run = Level=Differential 2nd-5th sun at 2:05
  Run = Level=Incremental Pool=Daily mon-sat at 2:05
}
</PRE>
<P>
The first of every month: 

<P>
<PRE>
Schedule {
  Name = "First"
  Run = Level=Full on 1 at 2:05
  Run = Level=Incremental on 2-31 at 2:05
}
</PRE>
<P>
Every 10 minutes: 

<P>
<PRE>
Schedule {
  Name = "TenMinutes"
  Run = Level=Full hourly at 0:05
  Run = Level=Full hourly at 0:15
  Run = Level=Full hourly at 0:25
  Run = Level=Full hourly at 0:35
  Run = Level=Full hourly at 0:45
  Run = Level=Full hourly at 0:55
}
</PRE>
<P>

<H1><A NAME="SECTION001860000000000000000">
Technical Notes on Schedules</A>
</H1>
<A NAME="7394"></A>
<A NAME="7395"></A>

<P>
Internally Bacula keeps a schedule as a bit mask. There are six masks and a
minute field to each schedule. The masks are hour, day of the month (mday),
month, day of the week (wday), week of the month (wom), and week of the year
(woy). The schedule is initialized to have the bits of each of these masks
set, which means that at the beginning of every hour, the job will run. When
you specify a month for the first time, the mask will be cleared and the bit
corresponding to your selected month will be selected. If you specify a second
month, the bit corresponding to it will also be added to the mask. Thus when
Bacula checks the masks to see if the bits are set corresponding to the
current time, your job will run only in the two months you have set. Likewise,
if you set a time (hour), the hour mask will be cleared, and the hour you
specify will be set in the bit mask and the minutes will be stored in the
minute field. 

<P>
For any schedule you have defined, you can see how these bits are set by doing
a <B>show schedules</B> command in the Console program. Please note that the
bit mask is zero based, and Sunday is the first day of the week (bit zero). 

<P>
-
<P>

<H1><A NAME="SECTION001870000000000000000"></A>
<A NAME="FileSetResource"></A>
<BR>
The FileSet Resource
</H1>
<A NAME="8459"></A>
<A NAME="8460"></A>

<P>
The FileSet resource defines what files are to be included or excluded in a
backup job.  A <B>FileSet</B> resource is required for each backup Job.  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.

<P>
Any change to the list of the included files will cause Bacula to
automatically create a new FileSet (defined by the name and an MD5 checksum
of the Include/Exclude contents).  Each time a new FileSet is created,
Bacula will ensure that the next backup is always a Full save.

<P>
Bacula is designed to handle most character sets of the world,
US ASCII, German, French, Chinese, ...  However, it does this by
encoding everything in UTF-8, and it expects all configuration files
(including those read on Win32 machines) to be in UTF-8 format.
UTF-8 is typically the default on Linux machines, but not on all
Unix machines, nor on Windows, so you must take some care to ensure
that your locale is set properly before starting Bacula.  
On most modern Win32 machines, you can edit the conf files with <B>notebook</B> and choose output encoding UTF-8.

<P>
To ensure that Bacula configuration files can be correctly read including
foreign characters the bf LANG environment variable
must end in <B>.UTF-8</B>. An full example is <B>en_US.UTF-8</B>. The
exact syntax may vary a bit from OS to OS, and exactly how you define
it will also vary.

<P>
Bacula assumes that all filenames are in UTF-8 format on Linux and
Unix machines. On Win32 they are in Unicode (UTF-16), and will
be automatically converted to UTF-8 format.

<P>
<DL>
<DT><STRONG>FileSet</STRONG></DT>
<DD><A NAME="8467"></A>
<A NAME="8468"></A>
Start of the FileSet resource. One <B>FileSet</B>  resource must be
defined for each Backup job.

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="8472"></A>
<A NAME="8473"></A>
   The name of the FileSet resource.  This directive is required. 

<P>
</DD>
<DT><STRONG>Ignore FileSet Changes = yesno</STRONG></DT>
<DD><A NAME="8477"></A>
<A NAME="8478"></A>
   Normally, if you modify the FileSet Include or Exclude lists,
   the next backup will be forced to a Full so that Bacula can
   guarantee that any additions or deletions are properly saved.

<P>
We strongly recommend against setting this directive to yes, 
   since doing so may cause you to have an incomplete set of backups.

<P>
If this directive is set to <B>yes</B>, any changes you make to the
   FileSet Include or Exclude lists, will not force a Full during 
   subsequent backups.

<P>
The default is <B>no</B>, in which case, if you change the Include or
   Exclude, Bacula will force a Full backup to ensure that everything is
   properly backed up.

<P>
</DD>
<DT><STRONG>Enable VSS = yesno</STRONG></DT>
<DD><A NAME="8484"></A>
<A NAME="8485"></A>
  If this directive is set to <B>yes</B> the File daemon will be notified
  that the user wants to use a Volume Shadow Copy Service (VSS) backup
  for this job. The default is <B>yes</B>. This directive is effective
  only for VSS enabled Win32 File daemons. It permits a consistent copy
  of open files to be made for cooperating writer applications, and for
  applications that are not VSS away, Bacula can at least copy open files.
  The Volume Shadow Copy will only be done on Windows drives where the
  drive (e.g. C:, D:, ...) is explicitly mentioned in a <B>File</B>
  directive.
  For more information, please see the
  WindowsVSS chapter of this manual.

<P>
</DD>
<DT><STRONG>Include { Options {file-options} ...;
   file-list } </STRONG></DT>
<DD><A NAME="9498"></A>
<A NAME="8499"></A>

<P>
</DD>
<DT><STRONG>Options { file-options } </STRONG></DT>
<DD><A NAME="9499"></A>

<P>
</DD>
<DT><STRONG>Exclude { file-list }</STRONG></DT>
<DD><A NAME="9500"></A>
<A NAME="8508"></A>

<P>
</DD>
</DL>

<P>
The Include resource must contain a list of directories and/or files to be
processed in the backup job.  Normally, all files found in all
subdirectories of any directory in the Include File list will be backed up.
Note, see below for the definition of file-list.
The Include resource may also contain one or more Options resources that
specify options such as compression to be applied to all or any subset of
the files found when processing the file-list for backup. Please see
below for more details concerning Options resources.

<P>
There can be any number of <B>Include</B> resources within the FileSet, each
having its own list of directories or files to be backed up and the backup
options defined by one or more Options resources.  The <B>file-list</B>
consists of one file or directory name per line.  Directory names should be
specified without a trailing slash with Unix path notation.

<P>
Windows users, please take note to specify directories (even c:/...) in
Unix path notation. If you use Windows conventions, you will most likely
not be able to restore your files due to the fact that the Windows
path separator was defined as an escape character long before Windows
existed, and Bacula adheres to that convention (i.e. 
<BR>
means the next character
appears as itself).

<P>
You should always 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>) using Unix directory name separators
(forward slash).  The drive letter itself can be upper or lower case (e.g.
c:/xxx or C:/xxx).

<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 filesystems (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 filesystems.
Similarly on Windows systems, you must explicitly specify each of the
drives you want saved (e.g.
<B>c:/</B> and <B>d:/</B> ...). In addition, at least for Windows systems, you
will most likely want to enclose each specification within double quotes
particularly if the directory (or file) name contains spaces. 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>
Take special care not to include a directory twice or Bacula will backup
the same files two times wasting a lot of space on your archive device.
Including a directory twice is very easy to do.  For example:

<P>
<PRE>
  Include {
    File = /
    File = /usr
    Options { compression=GZIP }
  }
</PRE>
<P>
on a Unix system where /usr is a subdirectory (rather than a mounted
filesystem) will cause /usr to be backed up twice.

<P>
Please take note of the following items in the FileSet syntax: 

<P>

<OL>
<LI>There is no equal sign (=) after the Include and before the opening
   brace ({). The same is true for the Exclude. 
</LI>
<LI>Each directory (or filename) to be included or excluded is preceded by a <B>File
   =</B>.  Previously they were simply listed on separate lines. 
</LI>
<LI>The options that previously appeared on the Include line now must be
   specified within their own Options resource.
</LI>
<LI>The Exclude resource does not accept Options. 
</LI>
<LI>When using wild-cards or regular expressions, directory names are
   always terminated with a slash (/) and filenames have no trailing slash.
</LI>
</OL>

<P>
The Options resource is optional, but when specified, it will contain a
list of <B>keyword=value</B> options to be applied to the file-list.
See below for the definition of file-list.    
Multiple Options resources may be specified one after another.  As the
files are found in the specified directories, the Options will applied to
the filenames to determine if and how the file should be backed up.  The
wildcard and regular expression pattern matching parts of the
Options resources are checked in the order they are specified in the
FileSet until the first one that matches. Once one matches, the
compression and other flags within the Options specification will
apply to the pattern matched.

<P>
A key point is that in the absence of an Option or no other Option is
matched, every file is accepted for backing up. This means that if
you want to exclude something, you must explicitly specify an Option
with an <B>exclude = yes</B> and some pattern matching.

<P>
Once Bacula determines that the Options resource matches the file under
consideration, that file will be saved without looking at any other Options
resources that may be present.  This means that any wild cards must appear
before an Options resource without wild cards.

<P>
If for some reason, Bacula checks all the Options resources to a file under
consideration for backup, but there are no matches (generally because of wild
cards that don't match), Bacula as a default will then backup the file.  This
is quite logical if you consider the case of no Options clause is specified,
where you want everything to be backed up, and it is important to keep in mind
when excluding as mentioned above.

<P>
However, one additional point is that in the case that no match was found,
Bacula will use the options found in the last Options resource.  As a
consequence, if you want a particular set of "default" options, you should put
them in an Options resource after any other Options.

<P>
It is a good idea to put all your wild-card and regex expressions inside
double quotes to prevent conf file scanning problems.

<P>
This is perhaps a bit overwhelming, so there are a number of examples included 
below to illustrate how this works.

<P>
You find yourself using a lot of Regex statements, which will cost quite a lot
of CPU time, we recommend you simplify them if you can, or better yet
convert them to Wild statements which are much more efficient.

<P>
The directives within an Options resource may be one of the following: 

<P>
<DL>
<DT><STRONG>compression=GZIP</STRONG></DT>
<DD><A NAME="8528"></A>
<A NAME="8529"></A>
   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.  In fact,
   if you specify software compression at the same time you have hardware
   compression turned on, your files may actually take more space on the
   volume.

<P>
Software 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, otherwise it is generally better to rely your tape drive's
   hardware compression.  As noted above, it is not generally a good idea
   to do both software and hardware compression.

<P>
Specifying <B>GZIP</B> uses the default compression level 6 (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 six generally give very little extra
   compression and are rather CPU intensive.

<P>
You can overwrite this option per Storage resource with
   AllowCompressionAllowCompression option.

<P>
</DD>
<DT><STRONG>signature=SHA1</STRONG></DT>
<DD><A NAME="8539"></A>
<A NAME="8540"></A>
<A NAME="8541"></A>
   An SHA1 signature will be computed for all 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.) It adds
   four more bytes than the MD5 signature.  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.

<P>
</DD>
<DT><STRONG>signature=MD5</STRONG></DT>
<DD><A NAME="8542"></A>
<A NAME="8543"></A>
<A NAME="8544"></A>
   An MD5 signature will be computed for all files saved.  Adding this
   option generates about 5% extra overhead for each file saved.  In
   addition to the additional CPU time, the MD5 signature adds 16 more
   bytes per file to your catalog.  We strongly recommend that this option
   or the SHA1 option be specified as a default for all files.

<P>
</DD>
<DT><STRONG>basejob=options</STRONG></DT>
<DD><A NAME="8547"></A>
<A NAME="8548"></A>

<P>
The options letters specified are used when running a <B>Backup Level=Full</B>
with BaseJobs. The options letters are the same than in the <B>verify=</B>
option below.

<P>
</DD>
<DT><STRONG>accurate=options</STRONG></DT>
<DD><A NAME="8553"></A>
<A NAME="8554"></A>
   The options letters specified are used  when running a <B>Backup
   Level=Incremental/Differential</B> in Accurate mode. The options
   letters are the same than in the <B>verify=</B> option below.  

<P>
</DD>
<DT><STRONG>verify=options</STRONG></DT>
<DD><A NAME="8559"></A>
<A NAME="8560"></A>
   The options letters specified are used  when running a <B>Verify
   Level=Catalog</B> as well as the  <B>DiskToCatalog</B> level job. The options
   letters may be any  combination of the following:  

<P>
<DL>
<DT></DT>
<DD><B>i</B>
      compare the inodes  

<P>
</DD>
<DT></DT>
<DD><B>p</B>
      compare the permission bits  

<P>
</DD>
<DT></DT>
<DD><B>n</B>
      compare the number of links  

<P>
</DD>
<DT></DT>
<DD><B>u</B>
      compare the user id  

<P>
</DD>
<DT></DT>
<DD><B>g</B>
      compare the group id  

<P>
</DD>
<DT></DT>
<DD><B>s</B>
      compare the size  

<P>
</DD>
<DT></DT>
<DD><B>a</B>
      compare the access time  

<P>
</DD>
<DT></DT>
<DD><B>m</B>
      compare the modification time (st_mtime)  

<P>
</DD>
<DT></DT>
<DD><B>c</B>
      compare the change time (st_ctime)  

<P>
</DD>
<DT></DT>
<DD><B>d</B>
      report file size decreases  

<P>
</DD>
<DT></DT>
<DD><B>5</B>
      compare the MD5 signature  

<P>
</DD>
<DT></DT>
<DD><B>1</B>
      compare the SHA1 signature  
      
</DD>
</DL>

<P>
A useful set of general options on the <B>Level=Catalog</B>  or <B>   Level=DiskToCatalog</B>  verify is <B>pins5</B> i.e. compare permission bits,
   inodes, number  of links, size, and MD5 changes. 

<P>
</DD>
<DT><STRONG>onefs=yesno</STRONG></DT>
<DD><A NAME="8581"></A>
<A NAME="8582"></A>
   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.  If you are using a *nix system, you may not even be
   aware that there are several different filesystems as they are often
   automatically mounted by the OS (e.g.  /dev, /net, /sys, /proc, ...).
   With Bacula 1.38.0 or later, it will inform you when it decides not to
   traverse into another filesystem.  This can be very useful if you forgot
   to backup a particular partition.  An example of the informational
   message in the job report is:

<P>
<PRE>
rufus-fd: /misc is a different filesystem. Will not descend from / into /misc
rufus-fd: /net is a different filesystem. Will not descend from / into /net
rufus-fd: /var/lib/nfs/rpc_pipefs is a different filesystem. Will not descend from /var/lib/nfs into /var/lib/nfs/rpc_pipefs
rufus-fd: /selinux is a different filesystem. Will not descend from / into /selinux
rufus-fd: /sys is a different filesystem. Will not descend from / into /sys
rufus-fd: /dev is a different filesystem. Will not descend from / into /dev
rufus-fd: /home is a different filesystem. Will not descend from / into /home
</PRE>
<P>
Note: in previous versions of Bacula, the above message was of the form: 

<P>
<PRE>
Filesystem change prohibited. Will not descend into /misc
</PRE>
<P>
If you wish to backup multiple filesystems, you can  explicitly
   list each filesystem you want saved.  Otherwise, if you set the onefs option
   to <B>no</B>, Bacula 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 listed  in your FileSet, they will
   also be backed up. Normally, it is  preferable to set <B>onefs=yes</B> and to
   explicitly name  each filesystem you want backed up. Explicitly naming  the
   filesystems you want backed up avoids the possibility  of getting into a
   infinite loop recursing filesystems.  Another possibility is to 
   use <B>onefs=no</B> and to set <B>fstype=ext2, ...</B>.             
   See the example below for more details. 

<P>
If you think that Bacula should be backing up a particular directory
   and it is not, and you have <B>onefs=no</B> set, before you complain,
   please do:

<P>
<PRE>
  stat /
  stat &lt;filesystem&gt;
</PRE>
<P>
where you replace <B>filesystem</B> with the one in question.  If the 
<B>Device:</B> number is different for / and for your filesystem, then they
are on different filesystems.  E.g.
<PRE>
stat /
  File: `/'
  Size: 4096            Blocks: 16         IO Block: 4096   directory
Device: 302h/770d       Inode: 2           Links: 26
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2005-11-10 12:28:01.000000000 +0100
Modify: 2005-09-27 17:52:32.000000000 +0200
Change: 2005-09-27 17:52:32.000000000 +0200

stat /net
  File: `/home'
  Size: 4096            Blocks: 16         IO Block: 4096   directory
Device: 308h/776d       Inode: 2           Links: 7
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2005-11-10 12:28:02.000000000 +0100
Modify: 2005-11-06 12:36:48.000000000 +0100
Change: 2005-11-06 12:36:48.000000000 +0100
</PRE>
<P>
Also be aware that even if you include <B>/home</B> in your list
   of files to backup, as you most likely should, you will get the
   informational message that  "/home is a different filesystem" when 
   Bacula is processing the <B>/</B> directory.  This message does not
   indicate an error. This message means that while examining the 
   <B>File =</B> referred to in the second part of the message, Bacula will 
   not descend into the directory mentioned in the first part of the message.
   However, it is possible that the separate filesystem will be backed up 
   despite the message. For example, consider the following FileSet:

<P>
<PRE>
  File = /
  File = /var
</PRE>
<P>
where <B>/var</B> is a separate filesystem.  In this example, you will get a
   message saying that Bacula will not decend from <B>/</B> into <B>/var</B>.  But 
   it is important to realise that Bacula will descend into <B>/var</B> from the 
   second File directive shown above.  In effect, the warning is bogus,
   but it is supplied to alert you to possible omissions from your FileSet. In 
   this example, <B>/var</B> will be backed up.  If you changed the FileSet such 
   that it did not specify <B>/var</B>, then <B>/var</B> will not be backed up.

<P>
</DD>
<DT><STRONG>honor nodump flag=yesno</STRONG></DT>
<DD><A NAME="8616"></A>
<A NAME="8617"></A>
        If your file system supports the <B>nodump</B> flag (e. g. most
        BSD-derived systems) Bacula will honor the setting of the flag
        when this option is set to <B>yes</B>. Files having this flag set
        will not be included in the backup and will not show up in the
        catalog. For directories with the <B>nodump</B> flag set recursion
        is turned off and the directory will be listed in the catalog.
        If the <B>honor nodump flag</B> option is not defined
        or set to <B>no</B> every file and directory will be eligible for
        backup.

<P>
<A NAME="portable"></A></DD>
<DT><STRONG>portable=yesno</STRONG></DT>
<DD><A NAME="8625"></A>
<A NAME="8626"></A>
   If set to <B>yes</B> (default is <B>no</B>), the Bacula File daemon will
   backup Win32 files in a portable format, but not all Win32 file
   attributes will be saved and restored.  By default, this option is set
   to <B>no</B>, which means that on Win32 systems, the data will be backed
   up using Windows API calls and on WinNT/2K/XP, all the security and
   ownership attributes will be properly backed up (and restored).  However
   this format is not portable to other systems - e.g.  Unix, Win95/98/Me.
   When backing up Unix systems, this option is ignored, and unless you
   have a specific need to have portable backups, we recommend accept the
   default (<B>no</B>) so that the maximum information concerning your files
   is saved.

<P>
</DD>
<DT><STRONG>recurse=yesno</STRONG></DT>
<DD><A NAME="8632"></A>
<A NAME="8633"></A>
   If set to <B>yes</B> (the default), Bacula 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>, Bacula
   will save the subdirectory entries, but not descend into the
   subdirectories, and thus will not save the files or directories
   contained in the subdirectories.  Normally, you will want the default
   (<B>yes</B>).

<P>
</DD>
<DT><STRONG>sparse=yesno</STRONG></DT>
<DD><A NAME="8639"></A>
<A NAME="8640"></A>
   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> Bacula 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.

<P>
If you are not familiar with sparse files, an example is say a file
   where you wrote 512 bytes at address zero, then 512 bytes at address 1
   million.  The operating system will allocate only two blocks, and the
   empty space or hole will have nothing allocated.  However, when you read
   the sparse file and read the addresses where nothing was written, the OS
   will return all zeros as if the space were allocated, and if you backup
   such a file, a lot of space will be used to write zeros to the volume.
   Worse yet, when you restore the file, all the previously empty space
   will now be allocated using much more disk space.  By turning on the
   <B>sparse</B> option, Bacula will specifically look for empty space in
   the file, and any empty space will not be written to the Volume, nor
   will it be restored.  The price to pay for this is that Bacula must
   search each block it reads before writing it.  On a slow system, this
   may be important.  If you suspect you have sparse files, you should
   benchmark the difference or set sparse for only those files that are
   really sparse.

<P>
<A NAME="readfifo"></A></DD>
<DT><STRONG>readfifo=yesno</STRONG></DT>
<DD><A NAME="8647"></A>
<A NAME="8648"></A>
   If enabled, tells the Client to read the data on a backup and write the
   data on a restore to any FIFO (pipe) that is explicitly mentioned in the
   FileSet.  In this case, you must have a program already running that
   writes into the FIFO for a backup or reads from the FIFO on a restore.
   This can be accomplished with the <B>RunBeforeJob</B> directive.  If this
   is not the case, Bacula will hang indefinitely on reading/writing the
   FIFO. When this is not enabled (default), the Client simply saves the
   directory entry for the FIFO.

<P>
Unfortunately, when Bacula runs a RunBeforeJob, it waits until that
   script terminates, and if the script accesses the FIFO to write   
   into the it, the Bacula job will block and everything will stall.
   However, Vladimir Stavrinov as supplied tip that allows this feature   
   to work correctly.  He simply adds the following to the beginning
   of the RunBeforeJob script:

<P>
<PRE>
   exec &gt; /dev/null
</PRE>

<P>
</DD>
<DT><STRONG>noatime=yesno</STRONG></DT>
<DD><A NAME="8653"></A>
<A NAME="8654"></A>
   If enabled, and if your Operating System supports the O_NOATIME file
   open flag, Bacula will open all files to be backed up with this option.
   It makes it possible to read a file without updating the inode atime
   (and also without the inode ctime update which happens if you try to set
   the atime back to its previous value).  It also prevents a race
   condition when two programs are reading the same file, but only one does
   not want to change the atime.  It's most useful for backup programs and
   file integrity checkers (and bacula can fit on both categories).

<P>
This option is particularly useful for sites where users are sensitive
   to their MailBox file access time.  It replaces both the <B>keepatime</B>
   option without the inconveniences of that option (see below).

<P>
If your Operating System does not support this option, it will be
   silently ignored by Bacula.

<P>
</DD>
<DT><STRONG>mtimeonly=yesno</STRONG></DT>
<DD><A NAME="8657"></A>
<A NAME="8658"></A>
   If enabled, tells the Client that the selection of files during
   Incremental and Differential backups should based only on the st_mtime
   value in the stat() packet.  The default is <B>no</B> which means that
   the selection of files to be backed up will be based on both the
   st_mtime and the st_ctime values.  In general, it is not recommended
   to use this option.

<P>
</DD>
<DT><STRONG>keepatime=yesno</STRONG></DT>
<DD><A NAME="8661"></A>
<A NAME="8662"></A>
   The default is <B>no</B>.  When enabled, Bacula will reset the st_atime
   (access time) field of files that it backs up to their value prior to
   the backup.  This option is not generally recommended as there are very
   few programs that use st_atime, and the backup overhead is increased
   because of the additional system call necessary to reset the times.
   However, for some files, such as mailboxes, when Bacula backs up the
   file, the user will notice that someone (Bacula) has accessed the
   file. In this, case keepatime can be useful.
   (I'm not sure this works on Win32).

<P>
Note, if you use this feature, when Bacula resets the access time, the
   change time (st_ctime) will automatically be modified by the system,
   so on the next incremental job, the file will be backed up even if
   it has not changed. As a consequence, you will probably also want
   to use <B>mtimeonly = yes</B> as well as keepatime (thanks to
   Rudolf Cejka for this tip).

<P>
</DD>
<DT><STRONG>checkfilechanges=yesno</STRONG></DT>
<DD><A NAME="8666"></A>
<A NAME="8667"></A>
   On versions 2.0.4 or greater, 
   if enabled, the Client will check size, age of each file after 
   their backup to see if they have changed during backup. If time 
   or size mismatch, an error will raise.

<P>
<PRE>
 zog-fd: Client1.2007-03-31_09.46.21 Error: /tmp/test mtime changed during backup.
</PRE>

<P>
In general, it is recommended to use this option.

<P>
</DD>
<DT><STRONG>hardlinks=yesno</STRONG></DT>
<DD><A NAME="8671"></A>
<A NAME="8672"></A>
   When enabled (default), this directive will cause hard links to be 
   backed up. However, the File daemon keeps track of hard linked files and
   will backup the data only once. The process of keeping track of the 
   hard links can be quite expensive if you have lots of them (tens of
   thousands or more). This doesn't occur on normal Unix systems, but if
   you use a program like BackupPC, it can create hundreds of thousands, or
   even millions of hard links. Backups become very long and the File daemon
   will consume a lot of CPU power checking hard links.  In such a case,
   set <B>hardlinks=no</B> and hard links will not be backed up.  Note, using
   this option will most likely backup more data and on a restore the file
   system will not be restored identically to the original.

<P>
</DD>
<DT><STRONG>wild=string</STRONG></DT>
<DD><A NAME="8676"></A>
<A NAME="8677"></A>
   Specifies a wild-card string to be applied to the filenames and
   directory names.  Note, if <B>Exclude</B> is not enabled, the wild-card
   will select which files are to be included.  If <B>Exclude=yes</B> is
   specified, the wild-card will select which files are to be excluded.
   Multiple wild-card directives may be specified, and they will be applied
   in turn until the first one that matches.  Note, if you exclude a
   directory, no files or directories below it will be matched.

<P>
You may want to test your expressions prior to running your
   backup by using the bwild program. Please see the
   Utilitiesbwild chapter of this manual for
   more. You can also test your full FileSet definition by using
   the estimateestimate command in the Console        
   chapter of this manual.
   It is recommended to enclose the string in double quotes.

<P>
</DD>
<DT><STRONG>wilddir=string</STRONG></DT>
<DD><A NAME="8686"></A>
<A NAME="8687"></A>
   Specifies a wild-card string to be applied to directory names only.  No
   filenames will be matched by this directive.  Note, if <B>Exclude</B> is
   not enabled, the wild-card will select directories to be
   included.  If <B>Exclude=yes</B> is specified, the wild-card will select
   which directories are to be excluded.  Multiple wild-card directives may be
   specified, and they will be applied in turn until the first one that
   matches.  Note, if you exclude a directory, no files or directories
   below it will be matched.

<P>
It is recommended to enclose the string in double quotes.

<P>
You may want to test your expressions prior to running your
   backup by using the bwild program. Please see the
   Utilitiesbwild chapter of this manual for
   more. You can also test your full FileSet definition by using
   the estimateestimate command in the Console        
   chapter of this manual.
   An example of excluding with the WildDir option on Win32 machines is    
   presented below.

<P>
</DD>
<DT><STRONG>wildfile=string</STRONG></DT>
<DD><A NAME="8696"></A>
<A NAME="8697"></A>
   Specifies a wild-card string to be applied to non-directories. That
   is no directory entries will be matched by this directive.
   However, note that the match is done against the full path and filename,
   so your wild-card string must take into account that filenames
   are preceded by the full path.
   If <B>Exclude</B>
   is not enabled, the wild-card will select which files are to be
   included.  If <B>Exclude=yes</B> is specified, the wild-card will select
   which files are to be excluded.  Multiple wild-card directives may be
   specified, and they will be applied in turn until the first one that
   matches.

<P>
It is recommended to enclose the string in double quotes.

<P>
You may want to test your expressions prior to running your
   backup by using the bwild program. Please see the
   Utilitiesbwild chapter of this manual for
   more. You can also test your full FileSet definition by using
   the estimateestimate command in the Console        
   chapter of this manual.
   An example of excluding with the WildFile option on Win32 machines is    
   presented below.

<P>
</DD>
<DT><STRONG>regex=string</STRONG></DT>
<DD><A NAME="8706"></A>
<A NAME="8707"></A>
   Specifies a POSIX extended regular expression to be applied to the
   filenames and directory names, which include the full path.  If <B>   Exclude</B> is not enabled, the regex will select which files are to be
   included.  If <B>Exclude=yes</B> is specified, the regex will select
   which files are to be excluded.  Multiple regex directives may be
   specified within an Options resource, and they will be applied in turn
   until the first one that matches.  Note, if you exclude a directory, no
   files or directories below it will be matched.

<P>
It is recommended to enclose the string in double quotes.

<P>
The regex libraries differ from one operating system to
   another, and in addition, regular expressions are complicated,
   so you may want to test your expressions prior to running your
   backup by using the bregex program. Please see the
   Utilitiesbwild chapter of this manual for
   more. You can also test your full FileSet definition by using
   the estimateestimate command in the Console        
   chapter of this manual.

<P>
You find yourself using a lot of Regex statements, which will cost quite a lot
   of CPU time, we recommend you simplify them if you can, or better yet
   convert them to Wild statements which are much more efficient.

<P>
</DD>
<DT><STRONG>regexfile=string</STRONG></DT>
<DD><A NAME="8716"></A>
<A NAME="8717"></A>
   Specifies a POSIX extended regular expression to be applied to
   non-directories. No directories will be matched by this directive.  
   However, note that the match is done against the full path and
   filename, so your regex string must take into account that filenames
   are preceded by the full path.
   If <B>Exclude</B> is not enabled, the regex will select which files are
   to be included.  If <B>Exclude=yes</B> is specified, the regex will
   select which files are to be excluded.  Multiple regex directives may be
   specified, and they will be applied in turn until the first one that
   matches.

<P>
It is recommended to enclose the string in double quotes.

<P>
The regex libraries differ from one operating system to
   another, and in addition, regular expressions are complicated,
   so you may want to test your expressions prior to running your
   backup by using the bregex program. Please see the
   Utilitiesbregex chapter of this manual for
   more.

<P>
</DD>
<DT><STRONG>regexdir=string</STRONG></DT>
<DD><A NAME="8724"></A>
<A NAME="8725"></A>
   Specifies a POSIX extended regular expression to be applied to directory
   names only.  No filenames will be matched by this directive.  Note, if
   <B>Exclude</B> is not enabled, the regex will select directories
   files are to be included.  If <B>Exclude=yes</B> is specified, the
   regex will select which files are to be excluded.  Multiple
   regex directives may be specified, and they will be applied in turn
   until the first one that matches.  Note, if you exclude a directory, no
   files or directories below it will be matched.

<P>
It is recommended to enclose the string in double quotes.

<P>
The regex libraries differ from one operating system to
   another, and in addition, regular expressions are complicated,
   so you may want to test your expressions prior to running your
   backup by using the bregex program. Please see the
   Utilitiesbregex chapter of this manual for
   more.

<P>
</DD>
<DT><STRONG>exclude=yesno</STRONG></DT>
<DD><A NAME="8731"></A>
<A NAME="8732"></A>
   The default is <B>no</B>.  When enabled, any files matched within the
   Options will be excluded from the backup.

<P>
<A NAME="ACLSupport"></A></DD>
<DT><STRONG>aclsupport=yesno</STRONG></DT>
<DD><A NAME="8736"></A>
<A NAME="8737"></A>
   The default is <B>no</B>.  If this option is set to yes, and you have the
   POSIX <B>libacl</B> installed on your system, Bacula will backup the file
   and directory UNIX Access Control Lists (ACL) as defined in IEEE Std
   1003.1e draft 17 and "POSIX.1e" (abandoned).  This feature is
   available on UNIX only and depends on the ACL library.  Bacula is
   automatically compiled with ACL support if the <B>libacl</B> library is
   installed on your system (shown in config.out).  While restoring the
   files Bacula will try to restore the ACLs, if there is no ACL support
   available on the system, Bacula restores the files and directories but
   not the ACL information.  Please note, if you backup an EXT3 or XFS
   filesystem with ACLs, then you restore them to a different filesystem
   (perhaps reiserfs) that does not have ACLs, the ACLs will be ignored.

<P>
</DD>
<DT><STRONG>ignore case=yesno</STRONG></DT>
<DD><A NAME="8742"></A>
<A NAME="8743"></A>
   The default is <B>no</B>.  On Windows systems, you will almost surely
   want to set this to <B>yes</B>.  When this directive is set to <B>yes</B>
   all the case of character will be ignored in wild-card and regex
   comparisons.  That is an uppercase A will match a lowercase a.

<P>
</DD>
<DT><STRONG>fstype=filesystem-type</STRONG></DT>
<DD><A NAME="8747"></A>
<A NAME="8748"></A>
   This option allows you to select files and directories by the
   filesystem type.  The permitted filesystem-type names are:

<P>
ext2, jfs, ntfs, proc, reiserfs, xfs, usbdevfs, sysfs, smbfs,
   iso9660.  For ext3 systems, use ext2.

<P>
You may have multiple Fstype directives, and thus permit matching
   of multiple filesystem types within a single Options resource.  If
   the type specified on the fstype directive does not match the
   filesystem for a particular directive, that directory will not be
   backed up.  This directive can be used to prevent backing up
   non-local filesystems. Normally, when you use this directive, you
   would also set <B>onefs=no</B> so that Bacula will traverse filesystems.

<P>
This option is not implemented in Win32 systems.

<P>
</DD>
<DT><STRONG>DriveType=Windows-drive-type</STRONG></DT>
<DD><A NAME="8750"></A>
<A NAME="8751"></A>
   This option is effective only on Windows machines and is
   somewhat similar to the Unix/Linux <B>fstype</B> described
   above, except that it allows you to select what Windows
   drive types you want to allow.  By default all drive
   types are accepted.

<P>
The permitted drivetype names are:

<P>
removable, fixed, remote, cdrom, ramdisk

<P>
You may have multiple Driveype directives, and thus permit matching
   of multiple drive types within a single Options resource.  If
   the type specified on the drivetype directive does not match the
   filesystem for a particular directive, that directory will not be
   backed up.  This directive can be used to prevent backing up
   non-local filesystems. Normally, when you use this directive, you
   would also set <B>onefs=no</B> so that Bacula will traverse filesystems.

<P>
This option is not implemented in Unix/Linux systems.

<P>
</DD>
<DT><STRONG>hfsplussupport=yesno</STRONG></DT>
<DD><A NAME="8755"></A>
<A NAME="8756"></A>
   This option allows you to turn on support for Mac OSX HFS plus 
   finder information.

<P>
</DD>
<DT><STRONG>strippath=integer</STRONG></DT>
<DD><A NAME="8759"></A>
<A NAME="8760"></A>
   This option will cause <B>integer</B> paths to be stripped from
   the front of the full path/filename being backed up. This can
   be useful if you are migrating data from another vendor or if
   you have taken a snapshot into some subdirectory.  This directive
   can cause your filenames to be overlayed with regular backup data,
   so should be used only by experts and with great care.
</DD>
</DL>

<P>
<B>file-list</B> is a list of directory and/or filename names
specified with a <B>File =</B> directive. To include names containing spaces,
enclose the name between double-quotes. Wild-cards are not interpreted
in file-lists. They can only be specified in Options resources.

<P>
There are a number of special cases when specifying directories and files in a
<B>file-list</B>. They are: 

<P>

<UL>
<LI>Any name preceded by an at-sign (@) is assumed to be the  name of a
   file, which contains a list of files each preceded by a "File =".  The
   named file is read once when the configuration file is parsed during the
   Director startup.  Note, that the file is read on the Director's machine
   and not on the Client's.  In fact, the @filename can appear anywhere
   within the conf file where a token would be read, and the contents of
   the named file will be logically inserted in the place of the @filename.
   What must be in the file depends on the location the @filename is
   specified in the conf file.  For example:

<P>
<PRE>
Include {
  Options { compression=GZIP }
  @/home/files/my-files
}
</PRE>
<P>
</LI>
<LI>Any name beginning with a vertical bar () is  assumed to be the name of
   a program.  This program will be executed on the Director's machine 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. Before submitting the 
   specified command bacula will performe 
   character substitutioncharacter substitution.

<P>
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.  The
   examples below show you how to do this.  However, please note two
   things: 
<BR>
1.  if you want the local filesystems, you probably should be
   using the new <B>fstype</B> directive, which was added in version 1.36.3 
   and set <B>onefs=no</B>.
   
<BR>
<P>
2.  the exact syntax of the command needed in the examples below is very
   system dependent.  For example, on recent Linux systems, you may need to
   add the -P option, on FreeBSD systems, the options will be different as
   well.

<P>
In general, you will need to prefix your command or commands with a <B>   sh -c</B> so that they are invoked by a shell.  This will not be the case
   if you are invoking a script as in the second example below.  Also, you
   must take care to escape (precede with a &#92;) wild-cards,
   shell character, and to ensure that any spaces in your command are
   escaped as well.  If you use a single quotes (') within a double quote
   ("), Bacula will treat everything between the single quotes as one field
   so it will not be necessary to escape the spaces.  In general, getting
   all the quotes and escapes correct is a real pain as you can see by the
   next example.  As a consequence, it is often easier to put everything in
   a file and simply use the file name within Bacula.  In that case the
   <B>sh -c</B> will not be necessary providing the first line of the file
   is <B>#!/bin/sh</B>.

<P>
As an  example: 

<P>
<PRE>
 
Include {
   Options { signature = SHA1 }
   File = "|sh -c 'df -l | grep \"^/dev/hd[ab]\" | grep -v \".*/tmp\" \
      | awk \"{print \\$6}\"'"
}
</PRE>
<P>
will produce a list of all the local partitions on a Red Hat 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 &#92; and every " with a &#92;, and 
   you must also quote for the shell command. In the end, it is probably  easier
   just to execute a small file with: 

<P>
<PRE>
Include {
  Options {
    signature=MD5
  }
  File = "|my_partitions"
}
</PRE>
<P>
where my_partitions has: 

<P>
<PRE>
#!/bin/sh
df -l | grep "^/dev/hd[ab]" | grep -v ".*/tmp" \
      | awk "{print \$6}"
</PRE>
<P>
If the vertical bar (<code>|</code>) in front of my_partitions is preceded by a
   backslash as in &#92;<code>|</code>, the program will be executed on the
   Client's machine instead of on the Director's machine.
   Please note that if the filename is given within quotes, you
   will need to use two slashes.  An example, provided by John Donagher,
   that backs up all the local UFS partitions on a remote system is:

<P>
<PRE>
FileSet {
  Name = "All local partitions"
  Include {
    Options { signature=SHA1; onefs=yes; }
    File = "\\|bash -c \"df -klF ufs | tail +2 | awk '{print \$6}'\""
  }
}
</PRE>
<P>
The above requires two backslash characters after the double quote (one
   preserves  the next one). If you are a Linux user, just change the <B>ufs</B>
   to  <B>ext3</B> (or your preferred filesystem type), and you will be in 
   business.  

<P>
If you know what filesystems you have mounted on your system, e.g. 
   for Red Hat Linux normally only ext2 and ext3, you can backup
   all local filesystems using something like:

<P>
<PRE>
 
Include {
   Options { signature = SHA1; onfs=no; fstype=ext2 }
   File = /
}
</PRE>
<P>
</LI>
<LI>Any file-list item preceded by a less-than sign ()  will be taken
   to be a file. This file will be read on the Director's machine (see
   below for doing it on the Client machine) 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. The names should start in  column 1 and
   should not be quoted even if they contain  spaces. 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.
   For example: 

<P>
<PRE>
Include {
  Options { signature = SHA1 }
  File = "&lt;/home/files/local-filelist"
}
</PRE>
<P>
If you precede the less-than sign () with a backslash as in
   &#92;, the file-list will be read on the Client machine
   instead of on the Director's machine.  Please note that if the filename
   is given within quotes, you will need to use two slashes.

<P>
<PRE>
Include {
  Options { signature = SHA1 }
  File = "\\&lt;/home/xxx/filelist-on-client"
}
</PRE>
<P>
</LI>
<LI>If you explicitly specify a block device such as <B>/dev/hda1</B>,  then
   Bacula (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: 

<P>
<PRE>
Include {
  Options { signature=MD5; sparse=yes }
  File = /dev/hd6
}
</PRE>
<P>
will backup the data in device /dev/hd6. Note, the bf /dev/hd6 must be
   the raw partition itself. Bacula will not back it up as a raw device if
   you specify a symbolic link to a raw device such as my be created by the
   LVM Snapshot utilities.

<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 
    Disaster Recovery Using BaculaRescueChapter chapter of
   this manual. Then  save the whole disk partition. In the case of a disaster,
   you  can then restore the desired partition by again booting with  the rescue
   disk and doing a restore of the partition. 
</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: 

<P>
<PRE>
Include {
  Options {
    signature=SHA1
    readfifo=yes
  }
  File = /home/abc/fifo
}
</PRE>
<P>
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, Bacula will give up
   and 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 "hot" 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.  Be sure to
   read the readfifo sectionreadfifo that gives a
   tip to ensure that the RunBeforeJob does not block Bacula.

<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.

<P>
</LI>
<LI>A file-list may not contain wild-cards. Use directives in the
   Options resource if you wish to specify wild-cards or regular expression
   matching.

<P>
</LI>
<LI><A NAME="8815"></A>
The <B>ExcludeDirContaining = filename</B> is a directive that
can be added to the Include section of the FileSet resource.  If the specified
filename (<B>filename-string</B>) is found on the Client in any directory to be
backed up, the whole directory will be ignored (not backed up).  For example:

<P>
<PRE>
  # List of files to be backed up
  FileSet {
    Name = "MyFileSet"
    Include {
      Options {
        signature = MD5
      }
      File = /home
      Exclude Dir Containing = .excludeme
    }
  }
</PRE>

<P>
But in /home, there may be hundreds of directories of users and some
people want to indicate that they don't want to have certain
directories backed up. For example, with the above FileSet, if
the user or sysadmin creates a file named <B>.excludeme</B> in 
specific directories, such as

<P>
<PRE>
   /home/user/www/cache/.excludeme
   /home/user/temp/.excludeme
</PRE>

<P>
then Bacula will not backup the two directories named:

<P>
<PRE>
   /home/user/www/cache
   /home/user/temp
</PRE>

<P>
NOTE: subdirectories will not be backed up.  That is, the directive
applies to the two directories in question and any children (be they
files, directories, etc).

<P>
</LI>
</UL>

<P>

<H1><A NAME="SECTION001880000000000000000">
FileSet Examples</A>
</H1>
<A NAME="8828"></A>
<A NAME="8829"></A>

<P>
The following is an example of a valid FileSet resource definition.  Note,
the first Include pulls in the contents of the file <B>/etc/backup.list</B>
when Bacula is started (i.e.  the @), and that file must have each filename
to be backed up preceded by a <B>File =</B> and on a separate line.

<P>
<PRE>
FileSet {
  Name = "Full Set"
  Include {
    Options {
      Compression=GZIP
      signature=SHA1
      Sparse = yes
    }
    @/etc/backup.list
  }
  Include {
     Options {
        wildfile = "*.o"
        wildfile = "*.exe"
        Exclude = yes
     }
     File = /root/myfile
     File = /usr/lib/another_file
  }
}
</PRE>
<P>
In the above example, all the files contained in /etc/backup.list will
be compressed with GZIP compression, an SHA1 signature will be computed on the
file's contents (its data), and sparse file handling will apply. 

<P>
The two directories /root/myfile and /usr/lib/another_file will also be saved
without any options, but all files in those directories with the extensions
<B>.o</B> and <B>.exe</B> will be excluded. 

<P>
Let's say that you now want to exclude the directory /tmp. The simplest way
to do so is to add an exclude directive that lists /tmp.  The example
above would then become:

<P>
<PRE>
FileSet {
  Name = "Full Set"
  Include {
    Options {
      Compression=GZIP
      signature=SHA1
      Sparse = yes
    }
    @/etc/backup.list
  }
  Include {
     Options {
        wildfile = "*.o"
        wildfile = "*.exe"
        Exclude = yes
     }
     File = /root/myfile
     File = /usr/lib/another_file
  }
  Exclude {
     File = /tmp
  }
}
</PRE>
<P>
You can add wild-cards to the File directives listed in the Exclude
directory, but you need to take care because if you exclude a directory,
it and all files and directories below it will also be excluded.

<P>
Now lets take a slight variation on the above and suppose
you want to save all your whole filesystem except <B>/tmp</B>. 
The problem that comes up is that Bacula will not normally
cross from one filesystem to another.
Doing a <B>df</B> command, you get the following output: 

<P>
<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>
<P>
And we see that there are a number of separate filesystems (/ /boot
/home /rescue /tmp and /usr not to mention mounted systems).
If you specify only <B>/</B> in your Include list, Bacula will only save the
Filesystem <B>/dev/hda5</B>. To save all filesystems 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: 

<P>
<PRE>
FileSet {
  Name = Include_example
  Include {
    Options {
       wilddir = /proc
       wilddir = /tmp
       wildfile = "/.journal"
       wildfile = "/.autofsck"
       exclude = yes
    }
    File = /
    File = /boot
    File = /home
    File = /rescue
    File = /usr
  }
}
</PRE>
<P>
Since /tmp is on its own filesystem and it was not explicitly named in the
Include list, it is not really needed in the exclude list. It is better to
list it in the Exclude list for clarity, and in case the disks are changed so
that it is no longer in its own partition. 

<P>
Now, lets assume you only want to backup .Z and .gz files and nothing 
else. This is a bit trickier because Bacula by default will select 
everything to backup, so we must exclude everything but .Z and .gz files.
If we take the first example above and make the obvious modifications
to it, we might come up with a FileSet that looks like this:

<P>
<PRE>
FileSet {
  Name = "Full Set"
  Include {                    !!!!!!!!!!!!
     Options {                    This
        wildfile = "*.Z"          example
        wildfile = "*.gz"         doesn't
                                  work
     }                          !!!!!!!!!!!!
     File = /myfile
  }
}
</PRE>
<P>
The *.Z and *.gz files will indeed be backed up, but all other files
that are not matched by the Options directives will automatically
be backed up too (i.e. that is the default rule).

<P>
To accomplish what we want, we must explicitly exclude all other files.
We do this with the following:

<P>
<PRE>
FileSet {
  Name = "Full Set"
  Include {
     Options {
        wildfile = "*.Z"
        wildfile = "*.gz"
     }
     Options {
        Exclude = yes
        RegexFile = ".*"
     }
     File = /myfile
  }
}
</PRE>
<P>
The "trick" here was to add a RegexFile expression that matches
all files. It does not match directory names, so all directories in
/myfile will be backed up (the directory entry) and any *.Z and *.gz
files contained in them. If you know that certain directories do
not contain any *.Z or *.gz files and you do not want the directory
entries backed up, you will need to explicitly exclude those directories.
Backing up a directory entries is not very expensive.

<P>
Bacula uses the system regex library and some of them are
different on different OSes. The above has been reported not to work
on FreeBSD. This can be tested by using the <B>estimate job=job-name
listing</B> command in the console and adapting the RegexFile expression
appropriately. In a future version of Bacula, we will supply our own
Regex code to avoid such system dependencies.

<P>
Please be aware that allowing Bacula to traverse or change file systems can be
<B>very</B> dangerous. For example, with the following: 

<P>
<PRE>
FileSet {
  Name = "Bad example"
  Include {
    Options { onefs=no }
    File = /mnt/matou
  }
}
</PRE>
<P>
you will be backing up an NFS mounted partition (<B>/mnt/matou</B>), and since
<B>onefs</B> is set to <B>no</B>, Bacula will traverse file systems. Now 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>
As a final example, let's say that you have only one or two 
subdirectories of /home that you want to backup.  For example,
you want to backup only subdirectories beginning with the letter
a and the letter b - i.e. /home/a* and /home/b*.  Now, you might first
try:
<PRE>
FileSet {
  Name = "Full Set"
  Include {
     Options {
        wilddir = "/home/a*"
        wilddir = "/home/b*"
     }
     File = /home
  }
}
</PRE>
<P>
The problem is that the above will include everything in /home.  To get
things to work correctly, you need to start with the idea of exclusion
instead of inclusion.  So, you could simply exclude all directories
except the two you want to use:
<PRE>
FileSet {
  Name = "Full Set"
  Include {
     Options {
        RegexDir = "^/home/[c-z]"
        exclude = yes
     }
     File = /home
  }
}
</PRE>
<P>
And assuming that all subdirectories start with a lowercase letter, this
would work.

<P>
An alternative would be to include the two subdirectories desired and
exclude everything else:
<PRE>
FileSet {
  Name = "Full Set"
  Include {
     Options {
        wilddir = "/home/a*"
        wilddir = "/home/b*"
     }
     Options {
        RegexDir = ".*"
        exclude = yes
     }
     File = /home
  }
}
</PRE>
<P>
The following example shows how to back up only the My Pictures directory inside
the My Documents directory for all users in C:/Documents and Settings, i.e.
everything matching the pattern:

<P>
C:/Documents and Settings/*/My Documents/My Pictures/*

<P>
To understand how this can be achieved, there are two important points to
remember:

<P>
Firstly, Bacula walks over the filesystem depth-first starting from the File =
lines.  It stops descending when a directory is excluded, so you must include
all ancestor directories of each directory containing files to be included.

<P>
Secondly, each directory and file is compared to the Options clauses in the
order they appear in the FileSet.  When a match is found, no further clauses
are compared and the directory or file is either included or excluded.

<P>
The FileSet resource definition below implements this by including specifc
directories and files and excluding everything else.

<P>
<PRE>
FileSet {
  Name = "AllPictures"

  Include {

    File  = "C:/Documents and Settings"

    Options {
      signature = SHA1
      verify = s1
      IgnoreCase = yes

      # Include all users' directories so we reach the inner ones.  Unlike a
      # WildDir pattern ending in *, this RegExDir only matches the top-level
      # directories and not any inner ones.
      RegExDir = "^C:/Documents and Settings/[^/]+$"

      # Ditto all users' My Documents directories.
      WildDir = "C:/Documents and Settings/*/My Documents"

      # Ditto all users' My Documents/My Pictures directories.
      WildDir = "C:/Documents and Settings/*/My Documents/My Pictures"

      # Include the contents of the My Documents/My Pictures directories and
      # any subdirectories.
      Wild = "C:/Documents and Settings/*/My Documents/My Pictures/*"
    }

    Options {
      Exclude = yes
      IgnoreCase = yes

      # Exclude everything else, in particular any files at the top level and
      # any other directories or files in the users' directories.
      Wild = "C:/Documents and Settings/*"
    }
  }
}
</PRE>
<P>

<H1><A NAME="SECTION001890000000000000000">
Backing up Raw Partitions</A>
</H1>
<A NAME="8868"></A>
<A NAME="8869"></A>

<P>
The following FileSet definition will backup a raw partition: 

<P>
<PRE>
FileSet {
  Name = "RawPartition"
  Include {
    Options { sparse=yes }
    File = /dev/hda2
  }
}
</PRE>
<P>
While 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> directive. 

<P>

<H1><A NAME="SECTION0018100000000000000000">
Excluding Files and Directories</A>
</H1>
<A NAME="8874"></A>
<A NAME="8875"></A>

<P>
You may also include full filenames or directory names in addition to using
wild-cards and <B>Exclude=yes</B> in the Options resource as specified above by
simply including the files to be excluded in an Exclude resource within the
FileSet. For example: 

<P>
<PRE>
FileSet {
  Name = Exclusion_example
  Include {
    Options {
      Signature = SHA1
    }
    File = /
    File = /boot
    File = /home
    File = /rescue
    File = /usr
  }
  Exclude {
    File = /proc
    File = /tmp
    File = .journal
    File = .autofsck
  }
}
</PRE>
<P>
<A NAME="win32"></A>
<H1><A NAME="SECTION0018110000000000000000">
Windows FileSets</A>
</H1>
<A NAME="8881"></A>
<A NAME="8882"></A>
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
(&#92;). For example you might use the following
for a Windows machine to backup the "My Documents" directory: 

<P>
<PRE>
FileSet {
  Name = "Windows Set"
  Include {
    Options {
       WildFile = "*.obj"
       WildFile = "*.exe"
       exclude = yes
     }
     File = "c:/My Documents"
  }
}
</PRE>
<P>
For exclude lists to work correctly on Windows, you must observe the following
rules: 

<P>

<UL>
<LI>Filenames are case sensitive, so you must use the correct case.  
</LI>
<LI>To exclude a directory, you must not have a trailing slash on the 
   directory name.  
</LI>
<LI>If you have spaces in your filename, you must enclose the entire name 
   in double-quote characters ("). Trying to use a backslash before  the space
   will not work.  
</LI>
<LI>If you are using the old Exclude syntax (noted below), you may not
   specify a drive letter in the exclude.  The new syntax noted above
   should work fine including driver letters.
</LI>
</UL>

<P>
Thanks to Thiago Lima for summarizing the above items for us. If you are
having difficulties getting includes or excludes to work, you might want to
try using the <B>estimate job=xxx listing</B> command documented in the 
Console chapterestimate of this manual. 

<P>
On Win32 systems, if you move a directory or file or rename a file into the
set of files being backed up, and a Full backup has already been made, Bacula
will not know there are new files to be saved during an Incremental or
Differential backup (blame Microsoft, not me). To avoid this problem, please
<B>copy</B> any new directory or files into the backup area. If you do not have
enough disk to copy the directory or files, move them, but then initiate a
Full backup. 

<P>

<H4><A NAME="SECTION0018110010000000000000">
A Windows Example FileSet</A>
</H4>
<A NAME="8893"></A>
<A NAME="8894"></A>

<P>
The following example was contributed by Russell Howe. Please note that
for presentation purposes, the lines beginning with Data and Internet 
have been wrapped and should included on the previous line with one
space.

<P>
<PRE>
This is my Windows 2000 fileset:
FileSet {
 Name = "Windows 2000"
 Include {
  Options {
   signature = MD5
   Exclude = yes
   IgnoreCase = yes
   # Exclude Mozilla-based programs' file caches
   WildDir = "[A-Z]:/Documents and Settings/*/Application 
Data/*/Profiles/*/*/Cache"
   WildDir = "[A-Z]:/Documents and Settings/*/Application 
Data/*/Profiles/*/*/Cache.Trash"
   WildDir = "[A-Z]:/Documents and Settings/*/Application
Data/*/Profiles/*/*/ImapMail"

   # Exclude user's registry files - they're always in use anyway.
   WildFile = "[A-Z]:/Documents and Settings/*/Local Settings/Application
Data/Microsoft/Windows/usrclass.*"
   WildFile = "[A-Z]:/Documents and Settings/*/ntuser.*"

   # Exclude directories full of lots and lots of useless little files
   WildDir = "[A-Z]:/Documents and Settings/*/Cookies"
   WildDir = "[A-Z]:/Documents and Settings/*/Recent"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/History"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/Temp"
   WildDir = "[A-Z]:/Documents and Settings/*/Local Settings/Temporary
Internet Files"

   # These are always open and unable to be backed up
   WildFile = "[A-Z]:/Documents and Settings/All Users/Application
Data/Microsoft/Network/Downloader/qmgr[01].dat"

   # Some random bits of Windows we want to ignore
   WildFile = "[A-Z]:/WINNT/security/logs/scepol.log"
   WildDir = "[A-Z]:/WINNT/system32/config"
   WildDir = "[A-Z]:/WINNT/msdownld.tmp"
   WildDir = "[A-Z]:/WINNT/Internet Logs"
   WildDir = "[A-Z]:/WINNT/$Nt*Uninstall*"
   WildDir = "[A-Z]:/WINNT/sysvol"
   WildFile = "[A-Z]:/WINNT/cluster/CLUSDB"
   WildFile = "[A-Z]:/WINNT/cluster/CLUSDB.LOG"
   WildFile = "[A-Z]:/WINNT/NTDS/edb.log"
   WildFile = "[A-Z]:/WINNT/NTDS/ntds.dit"
   WildFile = "[A-Z]:/WINNT/NTDS/temp.edb"
   WildFile = "[A-Z]:/WINNT/ntfrs/jet/log/edb.log"
   WildFile = "[A-Z]:/WINNT/ntfrs/jet/ntfrs.jdb"
   WildFile = "[A-Z]:/WINNT/ntfrs/jet/temp/tmp.edb"
   WildFile = "[A-Z]:/WINNT/system32/CPL.CFG"
   WildFile = "[A-Z]:/WINNT/system32/dhcp/dhcp.mdb"
   WildFile = "[A-Z]:/WINNT/system32/dhcp/j50.log"
   WildFile = "[A-Z]:/WINNT/system32/dhcp/tmp.edb"
   WildFile = "[A-Z]:/WINNT/system32/LServer/edb.log"
   WildFile = "[A-Z]:/WINNT/system32/LServer/TLSLic.edb"
   WildFile = "[A-Z]:/WINNT/system32/LServer/tmp.edb"
   WildFile = "[A-Z]:/WINNT/system32/wins/j50.log"
   WildFile = "[A-Z]:/WINNT/system32/wins/wins.mdb"
   WildFile = "[A-Z]:/WINNT/system32/wins/winstmp.mdb"

   # Temporary directories &amp; files
   WildDir = "[A-Z]:/WINNT/Temp"
   WildDir = "[A-Z]:/temp"
   WildFile = "*.tmp"
   WildDir = "[A-Z]:/tmp"
   WildDir = "[A-Z]:/var/tmp"

   # Recycle bins
   WildDir = "[A-Z]:/RECYCLER"

   # Swap files
   WildFile = "[A-Z]:/pagefile.sys"

   # These are programs and are easier to reinstall than restore from
   # backup
   WildDir = "[A-Z]:/cygwin"
   WildDir = "[A-Z]:/Program Files/Grisoft"
   WildDir = "[A-Z]:/Program Files/Java"
   WildDir = "[A-Z]:/Program Files/Java Web Start"
   WildDir = "[A-Z]:/Program Files/JavaSoft"
   WildDir = "[A-Z]:/Program Files/Microsoft Office"
   WildDir = "[A-Z]:/Program Files/Mozilla Firefox"
   WildDir = "[A-Z]:/Program Files/Mozilla Thunderbird"
   WildDir = "[A-Z]:/Program Files/mozilla.org"
   WildDir = "[A-Z]:/Program Files/OpenOffice*"
  }

  # Our Win2k boxen all have C: and D: as the main hard drives.
  File = "C:/"
  File = "D:/"
 }
}
</PRE>
<P>
Note, the three line of the above Exclude were split to fit on the document
page, they should be written on a single line in real use. 

<P>

<H4><A NAME="SECTION0018110020000000000000">
Windows NTFS Naming Considerations</A>
</H4>
<A NAME="8898"></A>
<A NAME="8899"></A>

<P>
NTFS filenames containing Unicode characters should now be supported
as of version 1.37.30 or later.

<P>

<H1><A NAME="SECTION0018120000000000000000">
Testing Your FileSet</A>
</H1>
<A NAME="8901"></A>
<A NAME="8902"></A>

<P>
If you wish to get an idea of what your FileSet will really backup or if your
exclusion rules will work correctly, you can test it by using the <B>estimate</B> command in the Console program. See the 
estimateestimate in the Console chapter of this
manual.

<P>
As an example, suppose you add the following test FileSet:

<P>
<PRE>
FileSet {
  Name = Test
  Include {
    File = /home/xxx/test
    Options {
       regex = ".*\.c$"
    }
  }
}
</PRE>
<P>
You could then add some test files to the directory <B>/home/xxx/test</B>
and use the following command in the console:

<P>
<PRE>
estimate job=&lt;any-job-name&gt; listing client=&lt;desired-client&gt; fileset=Test
</PRE>
<P>
to give you a listing of all files that match.

<P>

<H1><A NAME="SECTION0018130000000000000000"></A>
<A NAME="ClientResource2"></A>
<BR>
The Client Resource
</H1>
<A NAME="8913"></A>
<A NAME="8914"></A>

<P>
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. 

<P>
<DL>
<DT><STRONG>Client (or FileDaemon)</STRONG></DT>
<DD><A NAME="8916"></A>
   <A NAME="8917"></A>
   Start of the Client directives.  

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="8920"></A>
   <A NAME="8921"></A>
   The client name which will be used in the  Job resource directive or in the
console run command.  This directive is required.  

<P>
</DD>
<DT><STRONG>Address = address</STRONG></DT>
<DD><A NAME="8924"></A>
   <A NAME="8925"></A>
   <A NAME="8926"></A>
   <A NAME="8927"></A>
   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 directive is required.

<P>
</DD>
<DT><STRONG>FD Port = port-number</STRONG></DT>
<DD><A NAME="8930"></A>
   <A NAME="8931"></A>
   Where the port is a port  number at which the Bacula File server daemon can
   be contacted.  The default is 9102. 

<P>
</DD>
<DT><STRONG>Catalog = Catalog-resource-name</STRONG></DT>
<DD><A NAME="8934"></A>
   <A NAME="8935"></A>
   This specifies the  name of the catalog resource to be used for this Client. 
   This directive is required.  

<P>
</DD>
<DT><STRONG>Password = password</STRONG></DT>
<DD><A NAME="8938"></A>
   <A NAME="8939"></A>
   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 directive is 
   required.  If you have either <B>/dev/random</B>  <B>bc</B> on your machine,
   Bacula will generate a random  password during the configuration process,
   otherwise it will  be left blank. 

<P>
The password is plain text.  It is not generated through any special
   process, but it is preferable for security reasons to make the text
   random.

<P>
<A NAME="FileRetention"></A></DD>
<DT><STRONG>File Retention = time-period-specification</STRONG></DT>
<DD><A NAME="FileRetention"></A>   <A NAME="8946"></A>
   <A NAME="8947"></A>
   The File Retention directive defines the length of time that  Bacula will
   keep File records in the Catalog database after the End time of the
   Job corresponding to the File records.
   When this time period expires, and if
   <B>AutoPrune</B> is set to  <B>yes</B> Bacula will prune (remove) File records
   that  are older than the specified File Retention period. Note, this  affects
   only records in the catalog database. It does not  affect your archive
   backups.  

<P>
File records  may actually be retained for a shorter period than you specify
   on  this directive if you specify either a shorter <B>Job Retention</B>  or a
   shorter <B>Volume Retention</B> period. The shortest  retention period of the
   three takes precedence.  The time may be expressed in seconds, minutes, 
   hours, days, weeks, months, quarters, or years. See the 
    Configuration chapterTime of this  manual for
   additional details of time specification. 

<P>
The  default is 60 days. 

<P>
<A NAME="JobRetention"></A></DD>
<DT><STRONG>Job Retention = time-period-specification</STRONG></DT>
<DD><A NAME="JobRetention"></A>   <A NAME="8958"></A>
   <A NAME="8959"></A>
   The Job Retention directive defines the length of time that  Bacula will keep
   Job records in the Catalog database after the Job End time.  When
   this time period expires, and if <B>AutoPrune</B> is set to <B>yes</B>
   Bacula will prune (remove) Job records that are older than the specified
   File Retention period.  As with the other retention periods, this
   affects only records in the catalog and not data in your archive backup.

<P>
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> directive 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 as seconds,  minutes, hours, days,
   weeks, months,  quarters, or years.  See the 
    Configuration chapterTime of this manual for
   additional details of  time specification.  

<P>
The default is 180 days.  

<P>
<A NAME="AutoPrune"></A></DD>
<DT><STRONG>AutoPrune = yesno</STRONG></DT>
<DD><A NAME="8969"></A>
   <A NAME="8970"></A>
   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.  Pruning affects only information in the catalog and not data 
   stored in the backup archives (on Volumes).  

<P>
</DD>
<DT><STRONG>Maximum Concurrent Jobs = number</STRONG></DT>
<DD><A NAME="8975"></A>
   <A NAME="8976"></A>
   where number  is the maximum number of Jobs with the current Client
   that  can run concurrently. Note, this directive 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.

<P>
</DD>
<DT><STRONG>Priority = number</STRONG></DT>
<DD><A NAME="8981"></A>
   <A NAME="8982"></A>
   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>

<P>
The following is an example of a valid Client resource definition: 

<P>
<PRE>
Client {
  Name = Minimatou
  FDAddress = minimatou
  Catalog = MySQL
  Password = very_good
}
</PRE>
<P>

<H1><A NAME="SECTION0018140000000000000000"></A>
<A NAME="StorageResource2"></A>
<BR>
The Storage Resource
</H1>
<A NAME="8988"></A>
<A NAME="8989"></A>

<P>
The Storage resource defines which Storage daemons are available for use by
the Director. 

<P>
<DL>
<DT><STRONG>Storage</STRONG></DT>
<DD><A NAME="8991"></A>
   <A NAME="8992"></A>
   Start of the Storage resources. At least one  storage resource must be
   specified. 

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="8995"></A>
   <A NAME="8996"></A>
   The name of the storage resource. This  name appears on the Storage directive
   specified in the Job resource and is required. 

<P>
</DD>
<DT><STRONG>Address = address</STRONG></DT>
<DD><A NAME="8999"></A>
   <A NAME="9000"></A>
   <A NAME="9001"></A>
   Where the address is a host name,  a <B>fully qualified domain name</B>, or an
   <B>IP address</B>. Please note  that the address 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
   directive is required. 

<P>
</DD>
<DT><STRONG>SD Port = port</STRONG></DT>
<DD><A NAME="9010"></A>
   <A NAME="9011"></A>
   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. 

<P>
</DD>
<DT><STRONG>Password = password</STRONG></DT>
<DD><A NAME="9014"></A>
   <A NAME="9015"></A>
   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 directive is
   required.  If you have either <B>/dev/random</B>  <B>bc</B> on your machine,
   Bacula will generate a random  password during the configuration process,
   otherwise it will  be left blank. 

<P>
The password is plain text.  It is not generated through any special
   process, but it is preferable for security reasons to use random text.

<P>
</DD>
<DT><STRONG>Device = device-name</STRONG></DT>
<DD><A NAME="9020"></A>
   <A NAME="9021"></A>
   This directive specifies the Storage daemon's name of the device
   resource to be used for the storage.  If you are using an Autochanger,
   the name specified here should be the name of the Storage daemon's
   Autochanger resource rather than the name of an individual device.  This
   name is not the physical device name, but the logical device name as
   defined on the <B>Name</B> directive contained in the <B>Device</B> or the
   <B>Autochanger</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>).
   Please take care not to define two different Storage resource directives
   in the Director that point to the same Device in the Storage daemon.
   Doing so may cause the Storage daemon to block (or hang) attempting to
   open the same device that is already open.  This directive is required.

<P>
<A NAME="MediaType"></A></DD>
<DT><STRONG>Media Type = MediaType</STRONG></DT>
<DD><A NAME="9031"></A>
   <A NAME="9032"></A>
   This directive 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, "HP DLT8000", 8mm,
   ...).  In addition, it is essential that you make the <B>Media Type</B>
   specification unique for each storage media type.  If you have two DDS-4
   drives that have incompatible formats, or if you have a DDS-4 drive and
   a DDS-4 autochanger, you almost certainly should specify different <B>   Media Types</B>.  During a restore, assuming a <B>DDS-4</B> Media Type is
   associated with the Job, Bacula can decide to use any Storage daemon
   that supports Media Type <B>DDS-4</B> and on any drive that supports it.

<P>
If you are writing to disk Volumes, you must make doubly sure that each
   Device resource defined in the Storage daemon (and hence in the
   Director's conf file) has a unique media type.  Otherwise for Bacula
   versions 1.38 and older, your restores may not work because Bacula
   will assume that you can mount any Media Type with the same name on
   any Device associated with that Media Type. This is possible with
   tape drives, but with disk drives, unless you are very clever you
   cannot mount a Volume in any directory - this can be done by creating
   an appropriate soft link.

<P>
Currently Bacula permits only a single Media Type per Storage           
   and Device definition. Consequently, if
   you have a drive that supports more than one Media Type, you can
   give a unique string to Volumes with different intrinsic Media 
   Type (Media Type = DDS-3-4 for DDS-3 and DDS-4 types), but then
   those volumes will only be mounted on drives indicated with the
   dual type (DDS-3-4).

<P>
If you want to tie Bacula to using a single Storage daemon or drive, you
   must specify a unique Media Type for that drive.  This is an important
   point that should be carefully understood.  Note, this applies equally
   to Disk Volumes.  If you define more than one disk Device resource in
   your Storage daemon's conf file, the Volumes on those two devices are in
   fact incompatible because one can not be mounted on the other device
   since they are found in different directories.  For this reason, you
   probably should use two different Media Types for your two disk Devices
   (even though you might think of them as both being File types).  You can
   find more on this subject in the Basic Volume
   ManagementDiskChapter chapter of this manual.

<P>
The <B>MediaType</B> specified in the Director's Storage resource, <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 directive
   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
   directive 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.

<P>
<A NAME="Autochanger1"></A></DD>
<DT><STRONG>Autochanger = yesno</STRONG></DT>
<DD><A NAME="9049"></A>
   <A NAME="9050"></A>
   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> or <B>update slots</B>
   command in the console program.  When <B>autochanger</B> is enabled, the
   algorithm used by Bacula to search for available volumes will be
   modified to consider only Volumes that are known to be in the
   autochanger's magazine.  If no <B>in changer</B> volume is found, Bacula
   will attempt recycling, pruning, ..., and if still no volume is found,
   Bacula will search for any volume whether or not in the magazine.  By
   privileging in changer volumes, this procedure minimizes operator
   intervention.  The default is <B>no</B>.

<P>
For the autochanger to be used, you must also specify <B>Autochanger =
   yes</B> in the Device ResourceAutochanger in the Storage daemon's
   configuration file as well as other important Storage daemon
   configuration information.  Please consult the Using
   AutochangersAutochangersChapter manual of this chapter for the
   details of using autochangers.

<P>
</DD>
<DT><STRONG>Maximum Concurrent Jobs = number</STRONG></DT>
<DD><A NAME="9068"></A>
   <A NAME="9069"></A>
   where number  is the maximum number of Jobs with the current
   Storage resource that can run concurrently.  Note, this directive 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.  However, if
   you set the Storage daemon's number of concurrent jobs greater than one,
   we recommend that you read the waring documented under Maximum
   Concurrent JobsDirMaxConJobs in the Director's resource or simply
   turn data spooling on as documented in the Data
   SpoolingSpoolingChapter chapter of this manual.

<P>
</DD>
<DT><STRONG>AllowCompression = yesno</STRONG></DT>
<DD><A NAME="AllowCompression"></A>   <A NAME="9080"></A>
   <A NAME="9081"></A>

<P>
This directive is optional, and if you specify <B>No</B> (the default is <B>     Yes</B>), it will cause backups jobs running on this storage resource to run
   without client File Daemon compression.  This effectively overrides
   compression options in FileSets used by jobs which use this storage
   resource.

<P>
</DD>
<DT><STRONG>Heartbeat Interval = time-interval</STRONG></DT>
<DD><A NAME="9086"></A>
   <A NAME="9087"></A>
   This directive is optional and if specified will cause the Director to
   set a keepalive interval (heartbeat) in seconds on each of the sockets
   it opens for the Storage resource.  This value will override any
   specified at the Director level.  It is implemented only on systems
   (Linux, ...) that provide the <B>setsockopt</B> TCP_KEEPIDLE function.
   The default value is zero, which means no change is made to the socket.

<P>
</DD>
</DL>

<P>
The following is an example of a valid Storage resource definition: 

<P>
<PRE>
# Definition of tape storage device
Storage {
  Name = DLTDrive
  Address = lpmatou
  Password = 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>
<P>

<H1><A NAME="SECTION0018150000000000000000"></A>
<A NAME="PoolResource"></A>
<BR>
The Pool Resource
</H1>
<A NAME="9094"></A>
<A NAME="9095"></A>

<P>
The Pool resource defines the set of storage Volumes (tapes or files) to be
used by Bacula 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 it 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. If your backup strategy calls for you to mount a different tape
each day, you will probably want to define a separate Pool for each day. For
more information on this subject, please see the 
Backup StrategiesStrategiesChapter chapter of this
manual. 

<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. Finally, if you change the Pool definition in the Director's
configuration file and restart Bacula, the pool will be updated alternatively
you can 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. Note, for the pool to be
automatically created or updated, it must be explicitly referenced by a Job
resource. 

<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 Volume names (and their attributes) to the Pool. For
Volumes to be used by Bacula 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 be 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 Bacula 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. <B>Bacula</B>
probably should do an <B>update pool</B> if you change the Pool definition, but
currently, you must do this manually using the <B>update pool</B> command in
the Console program. 

<P>
The Pool Resource defined in the Director's configuration file
(bacula-dir.conf) may contain the following directives: 

<P>
<DL>
<DT><STRONG>Pool</STRONG></DT>
<DD><A NAME="9116"></A>
   <A NAME="9117"></A>
   Start of the Pool resource.  There must be at least one Pool resource
   defined.

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="9120"></A>
   <A NAME="9121"></A>
   The name of the pool.  For most applications, you will use the default
   pool name <B>Default</B>.  This directive is required.

<P>
<A NAME="MaxVolumes"></A></DD>
<DT><STRONG>Maximum Volumes = number</STRONG></DT>
<DD><A NAME="9126"></A>
   <A NAME="9127"></A>
   This directive specifies the maximum number of volumes (tapes or files)
   contained in the pool.  This directive is optional, if omitted or set to
   zero, any number of volumes will be permitted.  In general, this
   directive is useful for Autochangers where there is a fixed number of
   Volumes, or for File storage where you wish to ensure that the backups
   made to disk files do not become too numerous or consume too much space.

<P>
</DD>
<DT><STRONG>Pool Type = type</STRONG></DT>
<DD><A NAME="9130"></A>
   <A NAME="9131"></A>
   This directive defines the pool type, which corresponds to the type of
   Job being run.  It is required and may be one of the following:

<P>
<DL COMPACT>
<DT>Backup</DT>
<DD>
</DD>
<DT>*Archive</DT>
<DD>
</DD>
<DT>*Cloned</DT>
<DD>
</DD>
<DT>*Migration</DT>
<DD>
</DD>
<DT>*Copy</DT>
<DD>
</DD>
<DT>*Save</DT>
<DD>
</DD>
</DL>
   Note, only Backup is current implemented.

<P>
</DD>
<DT><STRONG>Storage = storage-resource-name</STRONG></DT>
<DD><A NAME="9136"></A>
<A NAME="9137"></A>
   The Storage directive defines the name of the storage services where you
   want to backup the FileSet data.  For additional details, see the
   Storage Resource ChapterStorageResource2 of this manual.
   The Storage resource may also be specified in the Job resource,
   but the value, if any, in the Pool resource overrides any value
   in the Job. This Storage resource definition is not required by either
   the Job resource or in the Pool, but it must be specified in
   one or the other.  If not configuration error will result.

<P>
</DD>
<DT><STRONG>Use Volume Once = yesno</STRONG></DT>
<DD><A NAME="9143"></A>
   <A NAME="9144"></A>
   This directive 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 directive will most likely
   be phased out (deprecated), so you are recommended to use <B>Maximum
   Volume Jobs = 1</B> instead.

<P>
The value defined by this directive in the bacula-dir.conf file is the
   default value used when a Volume is created.  Once the volume is
   created, changing the value in the bacula-dir.conf file will not change
   what is stored for the Volume.  To change the value for an existing
   Volume you must use the <B>update</B> command in the Console.

<P>
Please see the notes below under <B>Maximum Volume Jobs</B> concerning
   using this directive with multiple simultaneous jobs.

<P>
</DD>
<DT><STRONG>Maximum Volume Jobs = positive-integer</STRONG></DT>
<DD><A NAME="9152"></A>
   <A NAME="9153"></A>
   This directive 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, and thus used again.  By setting <B>MaximumVolumeJobs</B> to
   one, you get the same effect as setting <B>UseVolumeOnce = yes</B>.

<P>
The value defined by this directive in the  bacula-dir.conf
   file is the default value used when a Volume  is created. Once the volume is
   created, changing the value  in the bacula-dir.conf file will not change what
   is stored  for the Volume. To change the value for an existing Volume  you
   must use the <B>update</B> command in the Console.  

<P>
If you are running multiple simultaneous jobs, this directive may not
   work correctly because when a drive is reserved for a job, this
   directive is not taken into account, so multiple jobs may try to 
   start writing to the Volume. At some point, when the Media record is
   updated, multiple simultaneous jobs may fail since the Volume can no
   longer be written.

<P>
</DD>
<DT><STRONG>Maximum Volume Files = positive-integer</STRONG></DT>
<DD><A NAME="9163"></A>
   <A NAME="9164"></A>
   This directive 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 and thus used again.  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.

<P>
The value defined by this directive in the bacula-dir.conf file is the
   default value used when a Volume is created.  Once the volume is
   created, changing the value in the bacula-dir.conf file will not change
   what is stored for the Volume.  To change the value for an existing
   Volume you must use the <B>update</B> command in the Console.

<P>
</DD>
<DT><STRONG>Maximum Volume Bytes = size</STRONG></DT>
<DD><A NAME="9173"></A>
   <A NAME="9174"></A>
   This directive 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, and thus the Volume can be re-used
   after recycling.  This value is checked and the <B>Used</B> status set
   while the job is writing to the particular volume.

<P>
This directive is particularly useful for restricting the size
   of disk volumes, and will work correctly even in the case of
   multiple simultaneous jobs writing to the volume.

<P>
The value defined by this directive in the bacula-dir.conf file is the
   default value used when a Volume is created.  Once the volume is
   created, changing the value in the bacula-dir.conf file will not change
   what is stored for the Volume.  To change the value for an existing
   Volume you must use the <B>update</B> command in the Console.

<P>
</DD>
<DT><STRONG>Volume Use Duration = time-period-specification</STRONG></DT>
<DD><A NAME="9183"></A>
   <A NAME="9184"></A>
   The Volume Use Duration directive 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, the next time a job
   runs that wants to access this Volume, and 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. Using the command <B>   status dir</B> applies algorithms similar to running jobs, so
   during such a command, the Volume status may also be changed.
   Once the Volume is
   recycled, it will be available for use again.

<P>
You might use this directive, 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.  Be careful about setting the duration to short periods such as 23
   hours, or you might experience problems of Bacula waiting for a tape
   over the weekend only to complete the backups Monday morning when an
   operator mounts a new tape.

<P>
The use duration 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. This
   directive is not intended to be used to limit volume sizes
   and will not work correctly (i.e. will fail jobs) if the use
   duration expires while multiple simultaneous jobs are writing
   to the volume.

<P>
Please note that the value defined by this directive in the  bacula-dir.conf
   file is the default value used when a Volume  is created. Once the volume is
   created, changing the value  in the bacula-dir.conf file will not change what
   is stored  for the Volume. To change the value for an existing Volume  you
   must use the 
   <B>update volume</B>UpdateCommand command in the Console.  

<P>
</DD>
<DT><STRONG>Catalog Files = yesno</STRONG></DT>
<DD><A NAME="9193"></A>
   <A NAME="9194"></A>
   This directive 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).  Also, without the File
   entries in the catalog, you will not be able to use the Console <B>   restore</B> command nor any other command that references File entries.

<P>
<A NAME="PoolAutoPrune"></A></DD>
<DT><STRONG>AutoPrune = yesno</STRONG></DT>
<DD><A NAME="9202"></A>
   <A NAME="9203"></A>
   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.

<P>
<A NAME="VolRetention"></A></DD>
<DT><STRONG>Volume Retention = time-period-specification</STRONG></DT>
<DD><A NAME="9209"></A>
   <A NAME="9210"></A>
   The Volume Retention directive defines the length of time that <B>   Bacula</B> will keep records associated with the Volume in
   the Catalog database after the End time of each Job written to the
   Volume.  When this time period expires, and if <B>AutoPrune</B> is set to
   <B>yes</B> Bacula may prune (remove) Job records that are older than the
   specified Volume Retention period if it is necessary to free up a
   Volume.  Recycling will not occur until it is absolutely necessary to
   free up a volume (i.e. no other writable volume exists).
   All File records associated with pruned Jobs are also
   pruned.  The time may be specified as seconds, minutes, hours, days,
   weeks, months, quarters, or years.  The <B>Volume Retention</B> is
   applied independently of the <B>Job Retention</B> and the <B>File
   Retention</B> periods defined in the Client resource.  This means that all
   the retentions periods are applied in turn and that the shorter period
   is the one that effectively takes precedence.  Note, that when the <B>   Volume Retention</B> period has been reached, and it is necessary to obtain
   a new volume, Bacula will prune both the Job and the File records.  This
   pruning could also occur during a <B>status dir</B> command because it
   uses similar algorithms for finding the next available Volume.

<P>
It is important to know that when the Volume Retention period expires, 
   Bacula does not automatically recycle a Volume. It attempts to keep the
   Volume data intact as long as possible before over writing the Volume.

<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.  However, one must
   keep in mind that if your <B>Volume Retention</B> period is too short, it
   may prune the last valid Full backup, and hence until the next Full
   backup is done, you will not have a complete backup of your system, and
   in addition, the next Incremental or Differential backup will be
   promoted to a Full backup.  As a consequence, the minimum <B>Volume
   Retention</B> period should be at twice the interval of your Full backups.
   This means that if you do a Full backup once a month, the minimum Volume
   retention period should be two months.

<P>
The default Volume retention period is 365 days, and either the default
   or the value defined by this directive in the bacula-dir.conf file is
   the default value used when a Volume is created.  Once the volume is
   created, changing the value in the bacula-dir.conf file will not change
   what is stored for the Volume.  To change the value for an existing
   Volume you must use the <B>update</B> command in the Console.

<P>
</DD>
<DT><STRONG>Action On Purge = Truncate</STRONG></DT>
<DD><A NAME="9223"></A>

<P>
This directive <B>ActionOnPurge=Truncate</B> instructs Bacula to truncate the
volume when it is purged with the <TT>purge volume action=truncate</TT>
command. It is useful to prevent disk based volumes from consuming too much
space.

<P>
<PRE>
Pool {
  Name = Default
  Action On Purge = Truncate
  ...
}
</PRE>

<P>
You can schedule the truncate operation at the end of your CatalogBackup job
like in this example:

<P>
<PRE>
Job {
 Name = CatalogBackup
 ...
 RunScript {
   RunsWhen=After
   RunsOnClient=No
   Console = "purge volume action=all allpools storage=File"
 }
}
</PRE>

<P>
<A NAME="PoolScratchPool"></A></DD>
<DT><STRONG>ScratchPool = pool-resource-name</STRONG></DT>
<DD><A NAME="9233"></A>
   <A NAME="9234"></A>
   This directive permits to specify a dedicate <I>Scratch</I> for the
   current pool. This pool will replace the special pool named <I>Scrach</I>
   for volume selection. For more information about <I>Scratch</I> see
   Scratch PoolTheScratchPool section of this manual. This is useful
   when using multiple storage sharing the same mediatype or when you want to
   dedicate volumes to a particular set of pool.

<P>
<A NAME="PoolRecyclePool"></A></DD>
<DT><STRONG>RecyclePool = pool-resource-name</STRONG></DT>
<DD><A NAME="9243"></A>
   <A NAME="9244"></A>
   This directive defines to which pool
   the Volume will be placed (moved) when it is recycled. Without
   this directive, a Volume will remain in the same pool when it is
   recycled. With this directive, it can be moved automatically to any
   existing pool during a recycle. This directive is probably most
   useful when defined in the Scratch pool, so that volumes will
   be recycled back into the Scratch pool. For more on the see the   
   Scratch PoolTheScratchPool section of this manual.

<P>
Although this directive is called RecyclePool, the Volume in
   question is actually moved from its current pool to the one
   you specify on this directive when Bacula prunes the Volume and
   discovers that there are no records left in the catalog and hence
   marks it as <B>Purged</B>.

<P>
<A NAME="PoolRecycle"></A></DD>
<DT><STRONG>Recycle = yesno</STRONG></DT>
<DD><A NAME="9252"></A>
   <A NAME="9253"></A>
   This directive specifies whether or not Purged Volumes may be recycled.
   If it is set to <B>yes</B> (default) and Bacula needs a volume but finds
   none that are appendable, it will search for and recycle (reuse) 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. If Recycle is set to <B>   no</B>, the Volume will not be recycled, and hence, the data will remain
   valid.  If you want to reuse (re-write) the Volume, and the recycle flag
   is no (0 in the catalog), you may manually set the recycle flag (update
   command) for a Volume to be reused.

<P>
Please note that the value defined by this directive in the
   bacula-dir.conf file is the default value used when a Volume is created.
   Once the volume is created, changing the value in the bacula-dir.conf
   file will not change what is stored for the Volume.  To change the value
   for an existing Volume you must use the <B>update</B> command in the
   Console.

<P>
When all Job and File records have been pruned or purged from the      
   catalog for a particular Volume, if that Volume is marked as
   Append, Full, Used, or Error, it will then be marked as Purged. Only
   Volumes marked as Purged will be considered to be converted to the
   Recycled state if the <B>Recycle</B> directive is set to <B>yes</B>.

<P>
<A NAME="RecycleOldest"></A></DD>
<DT><STRONG>Recycle Oldest Volume = yesno</STRONG></DT>
<DD><A NAME="9263"></A>
   <A NAME="9264"></A>
   This directive 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>pruned</B>
   respecting the retention periods of all Files and Jobs written to this
   Volume.  If all Jobs are pruned (i.e. the volume is Purged), then the
   Volume is recycled and will be used as the next Volume to be written.
   This directive respects any Job, File, or Volume retention periods that
   you may have specified, and as such it is <B>much</B> better to use this
   directive than the Purge Oldest Volume.

<P>
This directive can be useful if you have a fixed number of Volumes in the
   Pool and you want to cycle through them and you have specified the correct
   retention periods.  

<P>
However, if you use this directive and have only one
   Volume in the Pool, you will immediately recycle your Volume if you fill
   it and Bacula needs another one. Thus your backup will be totally invalid.
   Please use this directive with care. The default is <B>no</B>.

<P>
<A NAME="RecycleCurrent"></A>
<P>
</DD>
<DT><STRONG>Recycle Current Volume = yesno</STRONG></DT>
<DD><A NAME="9272"></A>
   <A NAME="9273"></A>
   If Bacula needs a new Volume, this directive instructs Bacula to Prune
   the volume respecting the Job and File retention periods.  If all Jobs
   are pruned (i.e.  the volume is Purged), then the Volume is recycled and
   will be used as the next Volume to be written.  This directive respects
   any Job, File, or Volume retention periods that you may have specified,
   and thus it is <B>much</B> better to use it rather than the Purge Oldest
   Volume directive.

<P>
This directive can be useful if you have: a fixed number of Volumes in
   the Pool, you want to cycle through them, and you have specified
   retention periods that prune Volumes before you have cycled through the
   Volume in the Pool.

<P>
However, if you use this directive and have only one Volume in the Pool,
   you will immediately recycle your Volume if you fill it and Bacula needs
   another one.  Thus your backup will be totally invalid.  Please use this
   directive with care.  The default is <B>no</B>.

<P>
<A NAME="PurgeOldest"></A>
<P>
</DD>
<DT><STRONG>Purge Oldest Volume = yesno</STRONG></DT>
<DD><A NAME="9280"></A>
   <A NAME="9281"></A>
   This directive 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 directive overrides any Job, File, or Volume
   retention periods that you may have specified.

<P>
This directive can be useful if you have a fixed number of Volumes in
   the Pool and you want to cycle through them and reusing the oldest one
   when all Volumes are full, but you don't want to worry about setting
   proper retention periods.  However, by using this option you risk losing
   valuable data.

<P>
Please be aware that <B>Purge Oldest Volume</B> disregards all retention
   periods. 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 directive.  To specify a retention period, use the
   <B>Volume Retention</B> directive (see above).

<P>
We <B>highly</B> recommend against using this directive, because it is
   sure that some day, Bacula will recycle a Volume that contains current
   data.  The default is <B>no</B>.

<P>
</DD>
<DT><STRONG>File Retention = time-period-specification</STRONG></DT>
<DD><A NAME="9289"></A>
   <A NAME="9290"></A>
   The File Retention directive defines the length of time that  Bacula will
   keep File records in the Catalog database after the End time of the
   Job corresponding to the File records. 

<P>
This directive takes precedence over Client directives of the same name. For
   example, you can decide to increase Retention times for Archive or OffSite
   Pool.

<P>
Note, this affects only records in the catalog database. It does not affect
   your archive backups.

<P>
For more information see Client documentation about
   FileRetentionFileRetention

<P>
</DD>
<DT><STRONG>Job Retention = time-period-specification</STRONG></DT>
<DD><A NAME="9295"></A>
   <A NAME="9296"></A>

<P>
The Job Retention directive defines the length of time that Bacula will keep
   Job records in the Catalog database after the Job End time.  As with the
   other retention periods, this affects only records in the catalog and not
   data in your archive backup.

<P>
This directive takes precedence over Client directives of the same name.
   For example, you can decide to increase Retention times for Archive or
   OffSite Pool.

<P>
For more information see Client side documentation
   JobRetentionJobRetention

<P>
</DD>
<DT><STRONG>Cleaning Prefix = string</STRONG></DT>
<DD><A NAME="9301"></A>
   <A NAME="9302"></A>
   This directive defines a prefix string, which if it matches the
   beginning of a Volume name during labeling of a Volume, the Volume will
   be defined with the VolStatus set to <B>Cleaning</B> and thus Bacula 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.

<P>
<A NAME="Label"></A></DD>
<DT><STRONG>Label Format = format</STRONG></DT>
<DD><A NAME="9308"></A>
   <A NAME="9309"></A>
   This directive specifies the format of the labels contained in this
   pool.  The format directive is used as a sort of template to create new
   Volume names during automatic Volume labeling.

<P>
The <B>format</B> should be specified in double quotes, and consists of
   letters, numbers and the special characters hyphen (<B>-</B>), underscore
   (<B>_</B>), colon (<B>:</B>), and period (<B>.</B>), which are the legal
   characters for a Volume name.  The <B>format</B> should be enclosed in
   double quotes (").

<P>
In addition, the format may contain a number of variable expansion
   characters which will be expanded by a complex algorithm allowing you to
   create Volume names of many different formats.  In all cases, the
   expansion process must resolve to the set of characters noted above that
   are legal Volume names.  Generally, these variable expansion characters
   begin with a dollar sign (<B>$</B>) or a left bracket (<B>[</B>).  If you
   specify variable expansion characters, you should always enclose the
   format with double quote characters (<B>"</B>).  For more details on
   variable expansion, please see the Variable
   ExpansionVarsChapter Chapter of this manual.

<P>
If no variable expansion characters are found in the string, the Volume
   name will be formed from the <B>format</B> string appended with the
   a unique number that increases.  If you do not remove volumes from the
   pool, this number should be the number of volumes plus one, but this
   is not guaranteed. The unique number will be edited as four
   digits with leading zeros.  For example, with a <B>Label Format =
   "File-"</B>, the first volumes will be named <B>File-0001</B>, <B>   File-0002</B>, ...

<P>
With the exception of Job specific variables, you can test your <B>   LabelFormat</B> by using the  var commandvar the Console Chapter
   of this manual.

<P>
In almost all cases, you should enclose the format specification (part
   after the equal sign) in double quotes.  Please note that this directive
   is deprecated and is replaced in version 1.37 and greater with a Python
   script for creating volume names.

<P>
</DD>
</DL>

<P>
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 a valid Bacula software volume label before <B>Bacula</B> will accept
the Volume.  This will be automatically done if you use the <B>label</B>
command.  Bacula can automatically label Volumes if instructed to do so,
but this feature is not yet fully implemented.

<P>
The following is an example of a valid Pool resource definition: 

<P>
<PRE>
 
Pool {
  Name = Default
  Pool Type = Backup
}
</PRE>
<P>

<H2><A NAME="SECTION0018151000000000000000"></A>
<A NAME="TheScratchPool"></A>
<BR>
The Scratch Pool
</H2>
<A NAME="9338"></A>
In general, you can give your Pools any name you wish, but there is one 
important restriction: the Pool named <B>Scratch</B>, if it exists behaves 
like a scratch pool of Volumes in that when Bacula needs a new Volume for 
writing and it cannot find one, it will look in the Scratch pool, and if
it finds an available Volume, it will move it out of the Scratch pool into
the Pool currently being used by the job.

<P>

<H1><A NAME="SECTION0018160000000000000000"></A>
<A NAME="CatalogResource"></A>
<BR>
The Catalog Resource
</H1>
<A NAME="9342"></A>
<A NAME="9343"></A>

<P>
The Catalog Resource defines what catalog to use for the current job.
Currently, Bacula can only handle a single database server (SQLite, MySQL,
PostgreSQL) 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. 

<P>
Since SQLite is compiled in, it always runs on the same machine
as the Director and the database must be directly accessible (mounted) from
the Director.  However, since both MySQL and PostgreSQL are networked
databases, they may reside either on the same machine as the Director
or on a different machine on the network.  See below for more details.

<P>
<DL>
<DT><STRONG>Catalog</STRONG></DT>
<DD><A NAME="9346"></A>
   <A NAME="9347"></A>
   Start of the Catalog resource.  At least one Catalog resource must be
defined.

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="9350"></A>
   <A NAME="9351"></A>
   The name of the Catalog.  No necessary relation to the database server
   name.  This name will be specified in the Client resource directive
   indicating that all catalog data for that Client is maintained in this
   Catalog.  This directive is required.

<P>
</DD>
<DT><STRONG>password = password</STRONG></DT>
<DD><A NAME="9354"></A>
   <A NAME="9355"></A>
   This specifies the password to use when logging into the database.  This
   directive is required.

<P>
</DD>
<DT><STRONG>DB Name = name</STRONG></DT>
<DD><A NAME="9358"></A>
   <A NAME="9359"></A>
   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 Bacula
   tables using this name.  This directive is required.

<P>
</DD>
<DT><STRONG>user = user</STRONG></DT>
<DD><A NAME="9362"></A>
   <A NAME="9363"></A>
   This specifies what user name to use to log into the database.  This
   directive is required.

<P>
</DD>
<DT><STRONG>DB Socket = socket-name</STRONG></DT>
<DD><A NAME="9366"></A>
   <A NAME="9367"></A>
   This is the name of  a socket to use on the local host to connect to the
   database. This directive 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. If the DB Socket is specified, the
   MySQL server must reside on the same machine as the Director.

<P>
</DD>
<DT><STRONG>DB Address = address</STRONG></DT>
<DD><A NAME="9372"></A>
   <A NAME="9373"></A>
   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 directive  is used
   only by MySQL and PostgreSQL and is ignored by SQLite if provided.  
   This directive is optional.  

<P>
</DD>
<DT><STRONG>DB Port = port</STRONG></DT>
<DD><A NAME="9378"></A>
   <A NAME="9379"></A>
   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 directive is used  only
   by MySQL and PostgreSQL and is ignored by SQLite if provided.  This
   directive is optional.

<P>
the
different

<P>
</DD>
</DL>

<P>
The following is an example of a valid Catalog resource definition: 

<P>
<PRE>
Catalog
{
  Name = SQLite
  dbname = bacula;
  user = bacula;
  password = ""                       # no password = no security
}
</PRE>
<P>
or for a Catalog on another machine: 

<P>
<PRE>
Catalog
{
  Name = MySQL
  dbname = bacula
  user = bacula
  password = ""
  DB Address = remote.acme.com
  DB Port = 1234
}
</PRE>
<P>

<H1><A NAME="SECTION0018170000000000000000"></A>
<A NAME="MessagesResource2"></A>
<BR>
The Messages Resource
</H1>
<A NAME="9388"></A>
<A NAME="9389"></A>

<P>
For the details of the Messages Resource, please see the 
Messages Resource ChapterMessagesChapter of this
manual. 

<P>

<H1><A NAME="SECTION0018180000000000000000"></A>
<A NAME="ConsoleResource1"></A>
<BR>
The Console Resource
</H1>
<A NAME="9394"></A>
<A NAME="9395"></A>

<P>
As of Bacula version 1.33 and higher, there are three different kinds of
consoles, which the administrator or user can use to interact with the
Director. These three kinds of consoles comprise three different security
levels. 

<P>

<UL>
<LI>The first console type is an <B>anonymous</B> or <B>default</B>  console,
   which has full privileges.  There is no console resource necessary for
   this type since the password is specified in the Director's resource and
   consequently such consoles do not have a name as defined on a <B>Name
   =</B> directive.  This is the kind of console that was initially
   implemented in versions prior to 1.33 and remains valid.  Typically you
   would use it only for  administrators.  

<P>
</LI>
<LI>The second type of console, and new to version 1.33 and  higher is a
   "named" console defined within a Console resource in both the Director's
   configuration file and in the Console's configuration file.  Both the
   names and the passwords in these two entries must match much as is the
   case for Client programs.

<P>
This second type of console begins with absolutely no privileges except
   those explicitly specified in the Director's Console resource.  Thus you
   can have multiple Consoles with different names and passwords, sort of
   like multiple users, each with different privileges.  As a default,
   these consoles can do absolutely nothing - no commands whatsoever.  You
   give them privileges or rather access to commands and resources by
   specifying access control lists in the Director's Console resource.  The
   ACLs are specified by a directive followed by a list of access names.
   Examples of this are shown below.

<P>
</LI>
<LI>The third type of console is similar to the above mentioned  one in that
   it requires a Console resource definition in both the Director and the
   Console.  In addition, if the console name, provided on the <B>Name =</B>
   directive, is the same as a Client name, that console is permitted to
   use the <B>SetIP</B> command to change the Address directive in the
   Director's client resource to the IP address of the Console.  This
   permits portables or other machines using DHCP (non-fixed IP addresses)
   to "notify" the Director of their current IP address.
</LI>
</UL>

<P>
The Console resource is optional and need not be specified. The following
directives are permitted within the Director's configuration resource: 

<P>
<DL>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="9406"></A>
   <A NAME="9407"></A>
   The name of the console. This  name must match the name specified in the
Console's configuration  resource (much as is the case with Client
definitions).  

<P>
</DD>
<DT><STRONG>Password = password</STRONG></DT>
<DD><A NAME="9410"></A>
   <A NAME="9411"></A>
   Specifies the password that must be supplied for a named Bacula Console
   to be authorized.  The same password must appear in the <B>Console</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 directive
   is required.  If you have either <B>/dev/random</B> <B>bc</B> on your
   machine, Bacula will generate a random password during the configuration
   process, otherwise it will be left blank.

<P>
The password is plain text.  It is not generated through any special
   process.  However, it is preferable for security reasons to choose 
   random text.      

<P>
</DD>
<DT><STRONG>JobACL = name-list</STRONG></DT>
<DD><A NAME="9417"></A>
   <A NAME="9418"></A>
   This directive is used to specify a list of Job resource names that can
   be accessed by the console.  Without this directive, the console cannot
   access any of the Director's Job resources.  Multiple Job resource names
   may be specified by separating them with commas, and/or by specifying
   multiple JobACL directives.  For example, the directive may be specified
   as:

<P>
<PRE>
    JobACL = kernsave, "Backup client 1", "Backup client 2"
    JobACL = "RestoreFiles"
</PRE>
<P>
With the above specification, the console can access the Director's  resources
for the four jobs named on the JobACL directives,  but for no others.  

<P>
</DD>
<DT><STRONG>ClientACL = name-list</STRONG></DT>
<DD><A NAME="9423"></A>
   <A NAME="9424"></A>
   This directive is used to  specify a list of Client resource names that can
be
accessed by  the console.  

<P>
</DD>
<DT><STRONG>StorageACL = name-list</STRONG></DT>
<DD><A NAME="9427"></A>
   <A NAME="9428"></A>
   This directive is used to  specify a list of Storage resource names that can
be accessed by  the console.  

<P>
</DD>
<DT><STRONG>ScheduleACL = name-list</STRONG></DT>
<DD><A NAME="9431"></A>
   <A NAME="9432"></A>
   This directive is used to  specify a list of Schedule resource names that can
   be accessed by the console.

<P>
</DD>
<DT><STRONG>PoolACL = name-list</STRONG></DT>
<DD><A NAME="9435"></A>
   <A NAME="9436"></A>
   This directive is used to  specify a list of Pool resource names that can be
   accessed by the console.

<P>
</DD>
<DT><STRONG>FileSetACL = name-list</STRONG></DT>
<DD><A NAME="9439"></A>
   <A NAME="9440"></A>
   This directive is used to specify a list of FileSet resource names that
   can be accessed by the console.

<P>
</DD>
<DT><STRONG>CatalogACL = name-list</STRONG></DT>
<DD><A NAME="9443"></A>
   <A NAME="9444"></A>
   This directive is used to specify a list of Catalog resource names that
   can be accessed by the console.

<P>
</DD>
<DT><STRONG>CommandACL = name-list</STRONG></DT>
<DD><A NAME="9447"></A>
   <A NAME="9448"></A>
   This directive is used to specify a list of of console commands that can
   be executed by the console.

<P>
</DD>
<DT><STRONG>WhereACL = string</STRONG></DT>
<DD><A NAME="9451"></A>
   <A NAME="9452"></A>
   This directive permits you to specify where a restricted console
   can restore files. If this directive is not specified, only the
   default restore location is permitted (normally <B>   /tmp/bacula-restores</B>. If <B>*all*</B> is specified any path the
   user enters will be accepted (not very secure), any other
   value specified (there may be multiple WhereACL directives) will
   restrict the user to use that path. For example, on a Unix system,
   if you specify "/", the file will be restored to the original 
   location.  This directive is untested.

<P>
</DD>
</DL>

<P>
Aside from Director resource names and console command names, the special
keyword <B>*all*</B> can be specified in any of the above access control lists.
When this keyword is present, any resource or command name (which ever is
appropriate) will be accepted. For an example configuration file, please see
the 
Console ConfigurationConsoleConfChapter chapter of this
manual. 

<P>

<H1><A NAME="SECTION0018190000000000000000"></A>
<A NAME="CounterResource"></A>
<BR>
The Counter Resource
</H1>
<A NAME="9461"></A>
<A NAME="9462"></A>

<P>
The Counter Resource defines a counter variable that can be accessed by
variable expansion used for creating Volume labels with the <B>LabelFormat</B>
directive. See the 
LabelFormatLabel directive in this chapter for more
details. 

<P>
<DL>
<DT><STRONG>Counter</STRONG></DT>
<DD><A NAME="9467"></A>
   <A NAME="9468"></A>
   Start of the Counter resource.  Counter directives are optional. 

<P>
</DD>
<DT><STRONG>Name = name</STRONG></DT>
<DD><A NAME="9471"></A>
   <A NAME="9472"></A>
   The name of the Counter.  This is the name you will use in the variable
expansion  to reference the counter value.  

<P>
</DD>
<DT><STRONG>Minimum = integer</STRONG></DT>
<DD><A NAME="9475"></A>
   <A NAME="9476"></A>
   This specifies the minimum  value that the counter can have. It also becomes
the default.  If not supplied, zero is assumed.  

<P>
</DD>
<DT><STRONG>Maximum = integer</STRONG></DT>
<DD><A NAME="9479"></A>
   <A NAME="9480"></A>
   <A NAME="9481"></A>
   This is the maximum value  value that the counter can have. If not specified
or set to  zero, the counter can have a maximum value of 2,147,483,648  (2 to
the 31 power). When the counter is incremented past  this value, it is reset
to the Minimum.  

<P>
</DD>
<DT><STRONG>*WrapCounter = counter-name</STRONG></DT>
<DD><A NAME="9484"></A>
   <A NAME="9485"></A>
   If this value  is specified, when the counter is incremented past the
maximum 
and thus reset to the minimum, the counter specified on the  <B>WrapCounter</B>
is incremented. (This is not currently  implemented). 

<P>
</DD>
<DT><STRONG>Catalog = catalog-name</STRONG></DT>
<DD><A NAME="9489"></A>
   <A NAME="9490"></A>
   If this directive is  specified, the counter and its values will be saved in 
the specified catalog. If this directive is not present, the  counter will be
redefined each time that Bacula is started. 
</DD>
</DL>

<P>

<H1><A NAME="SECTION0018200000000000000000"></A>
<A NAME="SampleDirectorConfiguration"></A>
<BR>
Example Director Configuration File
</H1>
<A NAME="9494"></A>
<A NAME="9495"></A>

<P>
An example Director configuration file might be the following: 

<P>
<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"
  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 {
    Options { signature=SHA1}
#
#  Put your list of files here, one per line or include an
#    external list with:
#
#    @file-name
#
#  Note: / backs up everything
  File = /
}
  Exclude {}
}
# When to do the backups
Schedule {
  Name = "WeeklyCycle"
  Run = level=Full sun at 2:05
  Run = level=Incremental mon-sat at 2: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 for a DLT autochanger device
Storage {
  Name = Autochanger
  Address = rufus
  Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
  Device = "Autochanger"    # same as Device in Storage daemon
  Media Type = DLT-8000     # Different from DLTDrive
  Autochanger = yes
}
# 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
#   the 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
}
#
# Restricted console used by tray-monitor to get the status of the director
#
Console {
  Name = Monitor
  Password = "GN0uRo7PTUmlMbqrJ2Gr1p0fk0HQJTxwnFyE4WSST3MWZseR"
  CommandACL = status, .status
}
</PRE>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1447"
  HREF="Client_File_daemon_Configur.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1441"
  HREF="Bacula_Main_Reference.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1435"
  HREF="Customizing_Configuration_F.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1443"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1445"
  HREF="Thanks.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1448"
  HREF="Client_File_daemon_Configur.html">Client/File daemon Configuration</A>
<B> Up:</B> <A NAME="tex2html1442"
  HREF="Bacula_Main_Reference.html">Bacula Main Reference</A>
<B> Previous:</B> <A NAME="tex2html1436"
  HREF="Customizing_Configuration_F.html">Customizing the Configuration Files</A>
 &nbsp; <B>  <A NAME="tex2html1444"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1446"
  HREF="Thanks.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2012-01-24
</ADDRESS>
</BODY>
</HTML>