
#include "bacula_template.inc" title="Bacula File Services"

<H1>File Services Daemon</H1>

<h3>General</h3>
Please note, this section is somewhat out of date as the
code has evolved significantly. The basic idea has not
changed though.

<p>This chapter is intended to be a technical discussion of the
File daemon services and as such is not targeted at end users but
rather at developers and system administrators that want or
need to know more of the working details of <b>Bacula</b>.


<p>The <b>Bacula File Services</b> consist of the programs that
run on the system to be backed up and provide the interface
between the Host File system and Bacula -- in particular,
the Director and the Storage services.

<p>When time comes for a backup, the Director gets in touch with the
File daemon on the client machine and hands it a set of &quot;marching
orders&quot; which, if written in English, might be something like the
following:

<p class="indent">OK, <b>File daemon</b>, it's time for your daily
incremental backup.  I want you to get in touch with the Storage daemon
on host archive.mysite.com and perform the following save operations
with the designated options.  You'll note that I've attached include and
exclude lists and patterns you should apply when backing up the file
system.  As this is an incremental backup, you should save only files
modified since the time you started your last backup which, as you may
recall, was 2000-11-19-06:43:38.  Please let me know when you're done
and how it went.  Thank you.</p>

<p>So, having been handed everything it needs to decide what to dump and
where to store it, the File daemon doesn't need to have any further
contact with the Director until the backup is complete providing
there are no errors. If there are errors, the error messages will
be delivered immediately to the Director. While the
backup is proceeding, the File daemon will send the file coordinates and
data for each file being backed up to the Storage daemon, which will in
turn pass the file coordinates to the Director to put in the catalog.

<p>During a <b>Verify</b> of the catalog, the situation
is different, since the File
daemon will have an exchange with the Director for each file,
and will not contact the Storage daemon.

<p>A <b>Restore</b> operation will be very similar to the <b>Backup</b>
except that during the <b>Restore</b> the Storage daemon will not
send storage coordinates to the Director since the Director presumably
already has them. On the other hand, any error messages from either
the Storage daemon or File daemon will normally be sent directly to
the Directory (this, of course, depends on how the Message resource
is defined).

<h3>Commands Received from the Director for a Backup</h3>
<dl>
<dt>type = &lt;type&gt;</dt><dd>The backup type specifies the type of backup to be
done. It may be one of the following: 
<p class="tty">full, incremental, differential, level N, since date</p>
where
   <dl>
   <dt>full</dt><dd>is all files in the FileSet whether or not they have changed.
   <dt>incremental</dt><dd>is all files that have changed since the last backup.
   <dt>differential</dt><dd>is all files that have changed since the last Full backup.
   <dt>*level N</dt><dd>is all files that have changed since the last Level N backup.
   <dt>*since date</dt><dd>is all files that have changed since the date specified.
   </dl>
<dt>jobid = &lt;number&gt;</dt><dd>This is the unique JobId of the current
  Job. It is saved on the storage media with the File Attributes.
<dt>storage address = &lt;Storage-daemon-hostname&gt port = &lt;port-number&gt;</dt><dd>The
  Storage Address specifies the host name of the Storage daemon as well as its
  port number.
<dt>include = &lt;processing-attribute-list&gt; <br>&nbsp;&nbsp;&lt;file-list&gt; <br></dt><dd> 
  The Include Files
  specifies the list of files and/or directories to be included in the backup job. The
  &lt;processing-attribute-list&gt; is optional. If specified, it is a comma separated list of processing
  options to be applied to the file-list. These options are used to modify the 
  default processing behavior of the files included. The options to be modified may 
  be one of the following: 
  <dl>
  <dt>compression=</dt><dd></dd>
    <dl>
          <dt>*GZIP</dt><dd>All files saved will be compressed using the
             GNU ZIP compression format.  This code is only partially
             implemented please DO NOT USE it.
    </dl>
  <dt>signature=</dt><dd></dd>
    <dl>
          <dt>MD5</dt><dd>An MD5 signature will be computed for all files saved.
    </dl>
  <dt>encryption=</dt><dd>NOT IMPLEMENTED. PLEASE DO NOT USE.</dd>
    <dl>
          <dt>*blowfish</dt><dd>Blowfish encryption will be applied to all files saved.
          <dt>*3DES</dt><dd>The 3DES encryption will be applied to all files saved.
    </dl>
  <dt>verify=</dt><dd>Report changes in any of the following:</dd>
    <dl>
          <dt>p</dt><dd>permission bits</dd>
          <dt>i</dt><dd>inode number</dd> 
          <dt>n</dt><dd>number of links</dd>   
          <dt>u</dt><dd>userid</dd>    
          <dt>g</dt><dd>groupid</dd>
          <dt>s</dt><dd>file size change</dd>
          <dt>a</dt><dd>access time/date
          <dt>m</dt><dd>modification time/date    
          <dt>c</dt><dd>CTIME ref time/date       
          <dt>5</dt><dd>MD5 signature
          <dt>d</dt><dd>file size decrease        
    </dl>
  <dt>Miscellaneous not yet implemented. PLEASE DO NOT USE.</dt><dd></dd>
    <dl>
          <dt>noexec</dt><dd>All executable files will be automatically
              excluded from being saved.</dd>
          <dt>nofollow</dt><dd>Any symbolic link found will be saved, but
              the link will not be followed.  Thus the file to
              which the link points may not be saved.</dd>
          <dt>nonfs</dt><dd>Any file that resides on an NFS filesystem
              will not be saved.</dd>
          <dt>nodescent</dt><dd>Do not descend into directories found.</dd>
          <dt>sparse</dt><dd>Enable special code that checks for sparse
              files such as created by ndbm.</dd>  
          <dt>onefs</dt><dd>Remain on a single filesystem.</dd>
    </dl>
  </dl>
</dl>
<p>
The <b>&lt;file-list&gt;</b> is a list of filenames and/or directory names with
each name being on a separate line.  The filename may be enclosed in
quotes for easy inclusion of spaces.

<dl>
<dt>exclude<br> &nbsp;&nbsp;&lt;file-list&gt; <br></dt>
   <dd> The Exclude Files specifies the list of files and/or directories
        to be excluded from the backup job.  The &lt;file-list&gt; is a
        list of filenames and/or directory names with each name being on
        a separate line.  The &lt;file-list&gt; may contain wild-cards.
<dt>save</dt><dd>The save command causes the <b>File daemon</b> to begin
        sending the listed files to the Storage daemon to be saved.
</dl>

<h3>Commands Received from the Director for a Restore</h3>
To be written ...

<page_prev name="Storage Daemon Design" url="storage.html">
<page_next name="Bacula Catalog Services" url="catalog.html">
