Sophie

Sophie

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

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>Bacula Console</TITLE>
<META NAME="description" CONTENT="Bacula Console">
<META NAME="keywords" CONTENT="console">
<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="console.css">

<LINK REL="next" HREF="GNU_Free_Documentation_Lice.html">
<LINK REL="previous" HREF="Contents.html">
<LINK REL="up" HREF="Bacula_Console_Operators_Gu.html">
<LINK REL="next" HREF="GNU_Free_Documentation_Lice.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html58"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html52"
  HREF="Bacula_Console_Operators_Gu.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html46"
  HREF="Contents.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html54"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html56"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html59"
  HREF="GNU_Free_Documentation_Lice.html">GNU Free Documentation License</A>
<B> Up:</B> <A NAME="tex2html53"
  HREF="Bacula_Console_Operators_Gu.html">Bacula Console and Operators</A>
<B> Previous:</B> <A NAME="tex2html47"
  HREF="Contents.html">Contents</A>
 &nbsp; <B>  <A NAME="tex2html55"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html57"
  HREF="GNU_Free_Documentation_Lice.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="tex2html60"
  HREF="Bacula_Console.html#SECTION00210000000000000000">Console Configuration</A>
<LI><A NAME="tex2html61"
  HREF="Bacula_Console.html#SECTION00220000000000000000">Running the Console Program</A>
<LI><A NAME="tex2html62"
  HREF="Bacula_Console.html#SECTION00230000000000000000">Stopping the Console Program</A>
<LI><A NAME="tex2html63"
  HREF="Bacula_Console.html#SECTION00240000000000000000">Alphabetic List of Console Keywords</A>
<LI><A NAME="tex2html64"
  HREF="Bacula_Console.html#SECTION00250000000000000000">Alphabetic List of Console Commands</A>
<LI><A NAME="tex2html65"
  HREF="Bacula_Console.html#SECTION00260000000000000000">Special dot Commands</A>
<LI><A NAME="tex2html66"
  HREF="Bacula_Console.html#SECTION00270000000000000000">Special At (@) Commands</A>
<LI><A NAME="tex2html67"
  HREF="Bacula_Console.html#SECTION00280000000000000000">Running the Console from a Shell Script</A>
<LI><A NAME="tex2html68"
  HREF="Bacula_Console.html#SECTION00290000000000000000">Adding Volumes to a Pool</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION00200000000000000000"></A>
<A NAME="_ConsoleChapter"></A>
<BR>
Bacula Console
</H1>
<A NAME="66"></A>
<A NAME="67"></A>
<A NAME="68"></A>
<A NAME="69"></A>

<P>
The <B>Bacula Console</B> (sometimes called the User Agent) is a program that
allows the user or the System Administrator, to interact with the Bacula
Director daemon while the daemon is running. 

<P>
The current Bacula Console comes in two versions: a shell interface (TTY
style), and a QT GUI interface (Bat). Both permit the administrator or
authorized users to interact with Bacula. You can determine the status of a
particular job, examine the contents of the Catalog as well as perform certain
tape manipulations with the Console program.

<P>
In addition, there is a bwx-console built with wxWidgets that allows a graphic
restore of files. As of version 1.34.1 it is in an early stage of development,
but it already is quite useful. Unfortunately, it has not been enhanced for
some time now.

<P>
Since the Console program interacts with the Director through the network, your
Console and Director programs do not necessarily need to run on the same
machine. 

<P>
In fact, a certain minimal knowledge of the Console program is needed in order
for Bacula to be able to write on more than one tape, because when Bacula
requests a new tape, it waits until the user, via the Console program,
indicates that the new tape is mounted. 

<P>

<H1><A NAME="SECTION00210000000000000000">
Console Configuration</A>
</H1>
<A NAME="72"></A>
<A NAME="73"></A>
<A NAME="74"></A>
<A NAME="75"></A>

<P>
When the Console starts, it reads a standard Bacula configuration file
named <B>bconsole.conf</B> or <B>bat.conf</B> in the case of the Bat
QT Console version from the current directory unless you specify the <B>-c</B>
command line option (see below). This file allows default configuration 
of the Console, and at the current time, the only Resource Record defined
is the Director resource, which gives the Console the name and address of
the Director.  For more information on configuration of the Console
program, please see the Console Configuration
FileConsoleConfChapter Chapter of this document.

<P>

<H1><A NAME="SECTION00220000000000000000">
Running the Console Program</A>
</H1>
<A NAME="82"></A>
<A NAME="83"></A>
<A NAME="84"></A>
<A NAME="85"></A>

<P>
The console program can be run with the following options:
<PRE>
Usage: bconsole [-s] [-c config_file] [-d debug_level]
       -c &lt;file&gt;   set configuration file to file
       -dnn        set debug level to nn
       -n          no conio
       -s          no signals
       -u &lt;nn&gt;     set command execution timeout to &lt;nn&gt; seconds
       -t          test - read configuration and exit
       -?          print this message.
</PRE>
<P>
After launching the Console program (bconsole), it will prompt you for the next
command with an asterisk (*).  Generally, for all commands, you can simply
enter the command name and the Console program will prompt you for the
necessary arguments. Alternatively, in most cases, you may enter the command
followed by arguments. The general format is:

<P>
<PRE>
 &lt;command&gt; &lt;keyword1&gt;[=&lt;argument1&gt;] &lt;keyword2&gt;[=&lt;argument2&gt;] ...
</PRE>
<P>
where <B>command</B> is one of the commands listed below; <B>keyword</B> is one
of the keywords listed below (usually followed by an argument); and <B>argument</B> is the value. The command may be abbreviated to the shortest unique
form. If two commands have the same starting letters, the one that will be
selected is the one that appears first in the <B>help</B> listing. If you want
the second command, simply spell out the full command. None of the keywords
following the command may be abbreviated. 

<P>
For example: 

<P>
<PRE>
list files jobid=23
</PRE>
<P>
will list all files saved for JobId 23. Or: 

<P>
<PRE>
show pools
</PRE>
<P>
will display all the Pool resource records. 

<P>
The maximum command line length is limited to 511 characters, so if you
are scripting the console, you may need to take some care to limit the
line length.

<P>

<H1><A NAME="SECTION00230000000000000000">
Stopping the Console Program</A>
</H1>
<A NAME="99"></A>
<A NAME="100"></A>
<A NAME="101"></A>
<A NAME="102"></A>

<P>
Normally, you simply enter <B>quit</B> or <B>exit</B> and the Console program
will terminate. However, it waits until the Director acknowledges the command.
If the Director is already doing a lengthy command (e.g. prune), it may take
some time. If you want to immediately terminate the Console program, enter the
<B>.quit</B> command. 

<P>
There is currently no way to interrupt a Console command once issued (i.e.
Ctrl-C does not work). However, if you are at a prompt that is asking you to
select one of several possibilities and you would like to abort the command,
you can enter a period (<B>.</B>), and in most cases, you will either be
returned to the main command prompt or if appropriate the previous prompt (in
the case of nested prompts). In a few places such as where it is asking for a
Volume name, the period will be taken to be the Volume name. In that case, you
will most likely be able to cancel at the next prompt. 

<P>
<A NAME="keywords"></A>
<H1><A NAME="SECTION00240000000000000000">
Alphabetic List of Console Keywords</A>
</H1>
<A NAME="109"></A>
<A NAME="110"></A>
<A NAME="111"></A>
<A NAME="112"></A>
Unless otherwise specified, each of the following keywords
takes an argument, which is specified after the keyword following
an equal sign. For example:

<P>
<PRE>
jobid=536
</PRE>

<P>
Please note, this list is incomplete as it is currently in
the process of being created and is not currently totally in 
alphabetic
order ...

<P>
<DL>
<DT><STRONG>restart</STRONG></DT>
<DD>Permitted on the python command, and causes the Python 
  interpreter to be restarted. Takes no argument.
</DD>
<DT><STRONG>all</STRONG></DT>
<DD>Permitted on the status and show commands to specify all components or
  resources respectively.
</DD>
<DT><STRONG>allfrompool</STRONG></DT>
<DD>Permitted on the update command to specify that all Volumes in the
  pool (specified on the command line) should be updated.
</DD>
<DT><STRONG>allfrompools</STRONG></DT>
<DD>Permitted on the update command to specify that all Volumes in all
  pools should be updated.
</DD>
<DT><STRONG>before</STRONG></DT>
<DD>Used in the restore command.
</DD>
<DT><STRONG>bootstrap</STRONG></DT>
<DD>Used in the restore command.
</DD>
<DT><STRONG>catalog</STRONG></DT>
<DD>Allowed in the use command to specify the catalog name
  to be used.
</DD>
<DT><STRONG>catalogs</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>client | fd</STRONG></DT>
<DD>
</DD>
<DT><STRONG>clients</STRONG></DT>
<DD>Used in the show, list, and llist commands. Takes no arguments.
</DD>
<DT><STRONG>counters</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>current</STRONG></DT>
<DD>Used in the restore command. Takes no argument.
</DD>
<DT><STRONG>days</STRONG></DT>
<DD>Used to define the number of days the "list nextvol" command
  should consider when looking for jobs to be run.  The days keyword
  can also be used on the "status dir" command so that it will display
  jobs scheduled for the number of days you want.
</DD>
<DT><STRONG>devices</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>dir | director</STRONG></DT>
<DD>
</DD>
<DT><STRONG>directors</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>directory</STRONG></DT>
<DD>Used in the restore command. Its argument specifies the directory
  to be restored. 
</DD>
<DT><STRONG>enabled</STRONG></DT>
<DD>This keyword can appear on the <B>update volume</B> as well
  as the <B>update slots</B> commands, and can 
  allows one of the following arguments: yes, true, no, false, archived,
  0, 1, 2.  Where 0 corresponds to no or false, 1 corresponds to yes or true, and
  2 corresponds to archived.  Archived volumes will not be used, nor will
  the Media record in the catalog be pruned. Volumes that are not enabled,
  will not be used for backup or restore.
</DD>
<DT><STRONG>done</STRONG></DT>
<DD>Used in the restore command. Takes no argument.
</DD>
<DT><STRONG>file</STRONG></DT>
<DD>Used in the restore command.
</DD>
<DT><STRONG>files</STRONG></DT>
<DD>Used in the list and llist commands. Takes no arguments.
</DD>
<DT><STRONG>fileset</STRONG></DT>
<DD>
</DD>
<DT><STRONG>filesets</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>help</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>jobs</STRONG></DT>
<DD>Used in the show, list and llist commands. Takes no arguments.
</DD>
<DT><STRONG>jobmedia</STRONG></DT>
<DD>Used in the list and llist commands. Takes no arguments.
</DD>
<DT><STRONG>jobtotals</STRONG></DT>
<DD>Used in the list and llist commands. Takes no arguments.
</DD>
<DT><STRONG>jobid</STRONG></DT>
<DD>The JobId is the numeric jobid that is printed in the Job
  Report output. It is the index of the database record for the
  given job. While it is unique for all the existing Job records
  in the catalog database, the same JobId can be reused once a
  Job is removed from the catalog. Probably you will refer
  specific Jobs that ran using their numeric JobId.
</DD>
<DT><STRONG>job | jobname</STRONG></DT>
<DD>The Job or Jobname keyword refers to the name you specified
  in the Job resource, and hence it refers to any number of
  Jobs that ran.  It is typically useful if you want to list
  all jobs of a particular name.
</DD>
<DT><STRONG>level</STRONG></DT>
<DD>
</DD>
<DT><STRONG>listing</STRONG></DT>
<DD>Permitted on the estimate command. Takes no argument.
</DD>
<DT><STRONG>limit</STRONG></DT>
<DD>
</DD>
<DT><STRONG>messages</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>media</STRONG></DT>
<DD>Used in the list and llist commands. Takes no arguments.
</DD>
<DT><STRONG>nextvol | nextvolume</STRONG></DT>
<DD>Used in the list and llist commands. Takes no arguments.
</DD>
<DT><STRONG>on</STRONG></DT>
<DD>Takes no keyword.
</DD>
<DT><STRONG>off</STRONG></DT>
<DD>Takes no keyword.
</DD>
<DT><STRONG>pool</STRONG></DT>
<DD>
</DD>
<DT><STRONG>pools</STRONG></DT>
<DD>Used in the show, list, and llist commands. Takes no arguments.
</DD>
<DT><STRONG>select</STRONG></DT>
<DD>Used in the restore command. Takes no argument.
</DD>
<DT><STRONG>storages</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>schedules</STRONG></DT>
<DD>Used in the show command. Takes no arguments.
</DD>
<DT><STRONG>sd | store | storage</STRONG></DT>
<DD>
</DD>
<DT><STRONG>ujobid</STRONG></DT>
<DD>The ujobid is a unique job identification that is printed
  in the Job Report output. At the current time, it consists
  of the Job name (from the Name directive for the job) appended
  with the date and time the job was run. This keyword is useful
  if you want to completely identify the Job instance run.
</DD>
<DT><STRONG>volume</STRONG></DT>
<DD>
</DD>
<DT><STRONG>volumes</STRONG></DT>
<DD>Used in the list and llist commands. Takes no arguments.
</DD>
<DT><STRONG>where</STRONG></DT>
<DD>Used in the restore command.
</DD>
<DT><STRONG>yes</STRONG></DT>
<DD>Used in the restore command. Takes no argument.
</DD>
</DL>

<P>
<A NAME="list"></A>
<H1><A NAME="SECTION00250000000000000000">
Alphabetic List of Console Commands</A>
</H1>
<A NAME="121"></A>
<A NAME="122"></A>
<A NAME="123"></A>
<A NAME="124"></A>

<P>
The following commands are currently implemented: 

<P>
<DL>
<DT><STRONG>add [pool=pool-name storage=storage
   jobid=JobId] </STRONG></DT>
<DD><A NAME="132"></A>
   This command is used to add Volumes to an existing Pool.  That is,
   it creates the Volume name in the catalog and inserts into the Pool
   in the catalog, but does not attempt to access the physical Volume.
   Once
   added, Bacula expects that Volume to exist and to be labeled.
   This command is not normally used since Bacula will 
   automatically do the equivalent when Volumes are labeled. However,
   there may be times when you have removed a Volume from the catalog
   and want to later add it back.

<P>
Normally, the <B>label</B> command is used rather than this command
   because the <B>label</B> command labels the physical media (tape, disk,
   DVD, ...) and does the equivalent of the <B>add</B> command.  The <B>   add</B> command affects only the Catalog and not the physical media (data
   on Volumes).  The physical media must exist and be labeled before use
   (usually with the <B>label</B> command).  This command can, however, be
   useful if you wish to add a number of Volumes to the Pool that will be
   physically labeled at a later time.  It can also be useful if you are
   importing a tape from another site.  Please see the <B>label</B> command
   below for the list of legal characters in a Volume name.

<P>
</DD>
<DT><STRONG>autodisplay on/off</STRONG></DT>
<DD><A NAME="139"></A>
   This command accepts <B>on</B> or <B>off</B> as an argument, and turns
   auto-display of messages on or off respectively.  The default for the
   console program is <B>off</B>, which means that you will be notified when
   there are console messages pending, but they will not automatically be
   displayed.

<P>
When autodisplay is turned off, you must explicitly retrieve the
   messages with the <B>messages</B> command.  When autodisplay is turned
   on, the messages will be displayed on the console as they are received.

<P>
</DD>
<DT><STRONG>automount on/off</STRONG></DT>
<DD><A NAME="144"></A>
   This command accepts <B>on</B> or <B>off</B> as the argument, and turns
   auto-mounting of the Volume after a <B>label</B> command on or off
   respectively.  The default is <B>on</B>.  If <B>automount</B> is turned
   off, you must explicitly <B>mount</B> tape Volumes after a label command to
   use it.

<P>
</DD>
<DT><STRONG>cancel [jobid=number job=job-name ujobid=unique-jobid]</STRONG></DT>
<DD><A NAME="157"></A>
   This command is used to cancel a job and accepts <B>jobid=nnn</B> or <B>   job=xxx</B> as an argument where nnn is replaced by the JobId and xxx is
   replaced by the job name.  If you do not specify a keyword, the Console
   program will prompt you with the names of all the active jobs allowing
   you to choose one.

<P>
Once a Job is marked to be canceled, it may take a bit of time
   (generally within a minute but up to two hours) before the Job actually 
   terminates, depending on what operations it is doing.
   Don't be surprised that you receive a Job not found message. That just
   means that one of the three daemons had already canceled the job.
   Messages numbered in the 1000's are from the Director, 2000's are from
   the File daemon and 3000's from the Storage daemon.

<P>
</DD>
<DT><STRONG>create [pool=pool-name]</STRONG></DT>
<DD><A NAME="162"></A>
   This command is not normally used as the Pool records are automatically
   created by the Director when it starts based on what it finds in
   the conf file.  If needed, this command can be 
   to create a Pool record in the database using the
   Pool resource record defined in the Director's configuration file.  So
   in a sense, this command simply transfers the information from the Pool
   resource in the configuration file into the Catalog.  Normally this
   command is done automatically for you when the Director starts providing
   the Pool is referenced within a Job resource.  If you use this command
   on an existing Pool, it will automatically update the Catalog to have
   the same information as the Pool resource.  After creating a Pool, you
   will most likely use the <B>label</B> command to label one or more
   volumes and add their names to the Media database.

<P>
When starting a Job, if Bacula determines that there is no Pool record
   in the database, but there is a Pool resource of the appropriate name,
   it will create it for you.  If you want the Pool record to appear in the
   database immediately, simply use this command to force it to be created.

<P>
</DD>
<DT><STRONG>delete [volume=vol-name pool=pool-name  job
   jobid=id]</STRONG></DT>
<DD><A NAME="170"></A>
   The delete command is used to delete a Volume, Pool or Job record from
   the Catalog as well as all associated catalog Volume records that were
   created.  This command operates only on the Catalog database and has no
   effect on the actual data written to a Volume.  This command can be
   dangerous and we strongly recommend that you do not use it unless you
   know what you are doing.

<P>
If the keyword <B>Volume</B> appears on the command line, the named
   Volume will be deleted from the catalog, if the keyword <B>Pool</B>
   appears on the command line, a Pool will be deleted, and if the keyword
   <B>Job</B> appears on the command line, a Job and all its associated
   records (File and JobMedia) will be deleted from the catalog.  The full
   form of this command is:

<P>
<PRE>
delete pool=&lt;pool-name&gt;
</PRE>

<P>
or  

<P>
<PRE>
delete volume=&lt;volume-name&gt; pool=&lt;pool-name&gt;  or
</PRE>

<P>
<PRE>
delete JobId=&lt;job-id&gt; JobId=&lt;job-id2&gt; ...  or
</PRE>

<P>
<PRE>
delete Job JobId=n,m,o-r,t ...
</PRE>

<P>
The first form deletes a Pool record from the catalog database.  The
   second form deletes a Volume record from the specified pool in the
   catalog database.  The third form deletes the specified Job record from
   the catalog database.  The last form deletes JobId records for JobIds
   n, m, o, p, q, r, and t.  Where each one of the n,m,...  is, of course, a
   number. That is a "delete jobid" accepts lists and ranges of
   jobids.

<P>
</DD>
<DT><STRONG>disable jobjob-name</STRONG></DT>
<DD><A NAME="184"></A>
  This command permits you to disable a Job for automatic scheduling. 
  The job may have been previously enabled with the Job resource      
  <B>Enabled</B> directive or using the console <B>enable</B> command.
  The next time the Director is restarted or the conf file is reloaded,
  the Enable/Disable state will be set to the value in the Job resource
  (default enabled) as defined in the bacula-dir.conf file.

<P>
</DD>
<DT><STRONG>enable jobjob-name</STRONG></DT>
<DD><A NAME="189"></A>
  This command permits you to enable a Job for automatic scheduling. 
  The job may have been previously disabled with the Job resource      
  <B>Enabled</B> directive or using the console <B>disable</B> command.
  The next time the Director is restarted or the conf file is reloaded,
  the Enable/Disable state will be set to the value in the Job resource
  (default enabled) as defined in the bacula-dir.conf file.

<P>
<A NAME="estimate"></A></DD>
<DT><STRONG>estimate</STRONG></DT>
<DD><A NAME="193"></A>
   Using this command, you can get an idea how many files will be backed
   up, or if you are unsure about your Include statements in your FileSet,
   you can test them without doing an actual backup.  The default is to
   assume a Full backup.  However, you can override this by specifying a
   <B>level=Incremental</B> or <B>level=Differential</B> on the command line.
   A Job name must be specified or you will be prompted for one, and
   optionally a Client and FileSet may be specified on the command line.
   It then contacts the client which computes the number of files and bytes
   that would be backed up.  Please note that this is an estimate
   calculated from the number of blocks in the file rather than by reading
   the actual bytes.  As such, the estimated backup size will generally be
   larger than an actual backup. 

<P>
The <TT>estimate</TT> command can use the accurate code to detect changes
   and give a better estimation. You can set the accurate behavior on command
   line using <TT>accurate=yes/no</TT> or use the Job setting as default value.

<P>
Optionally you may specify the keyword <B>listing</B> in  which case, all the
   files to be backed up will be listed.  Note, it could take quite some time to
   display them if the  backup is large. The full form is:  

<P>
<PRE>
estimate job=&lt;job-name&gt; listing client=&lt;client-name&gt; accurate=&lt;yes/no&gt;
       fileset=&lt;fileset-name&gt; level=&lt;level-name&gt;
</PRE>

<P>
Specification of the <B>job</B> is sufficient, but you can also override the
   client, fileset, accurate and/or level by specifying them on the estimate
   command line.

<P>
As an example, you might do:  

<P>
<PRE>
     @output /tmp/listing
     estimate job=NightlySave listing level=Incremental
     @output
</PRE>
<P>
which will do a full listing of all files to be backed up for the  Job <B>   NightlySave</B> during an Incremental save and put it in the  file <B>   /tmp/listing</B>.  Note, the byte estimate provided by this command is 
   based on the file size contained in the directory item. This can give
   wildly incorrect estimates of the actual storage used if there are
   sparse files on your systems. Sparse files are often found on 64 bit 
   systems for certain system files. The size that is returned is the size
   Bacula will backup if the sparse option is not specified in the FileSet.
   There is currently no way to get an estimate of the real file size that 
   would be found should the sparse option be enabled.

<P>
</DD>
<DT><STRONG>exit</STRONG></DT>
<DD><A NAME="206"></A>
   This command terminates the console program.  

<P>
</DD>
<DT><STRONG>gui</STRONG></DT>
<DD><A NAME="207"></A>
   Invoke the non-interactive gui mode.
<PRE>
gui [on|off]
</PRE>

<P>
</DD>
<DT><STRONG>help</STRONG></DT>
<DD><A NAME="210"></A>
   This command displays the list of commands available.  

<P>
</DD>
<DT><STRONG>label</STRONG></DT>
<DD><A NAME="211"></A>
   <A NAME="212"></A>
   <A NAME="213"></A>
   <A NAME="214"></A>
   This command is used to label physical volumes.  The full form of this command
   is:

<P>
<PRE>
label storage=&lt;storage-name&gt; volume=&lt;volume-name&gt;
      slot=&lt;slot&gt;
</PRE>

<P>
If you leave out any part, you will be prompted for it.  The media type
   is automatically taken from the Storage resource definition that you
   supply.  Once the necessary information is obtained, the Console program
   contacts the specified Storage daemon and requests that the Volume be
   labeled.  If the Volume labeling is successful, the Console program will
   create a Volume record in the appropriate Pool.

<P>
The Volume name is restricted to letters, numbers, and the special
   characters hyphen (<B>-</B>), underscore (<B>_</B>), colon (<B>:</B>), and
   period (<B>.</B>).  All other characters including a space are invalid.
   This restriction is to ensure good readability of Volume names to reduce
   operator errors.

<P>
Please note, when labeling a blank tape, Bacula will get <B>read I/O
   error</B> when it attempts to ensure that the tape is not already labeled.  If
   you wish to avoid getting these messages, please write an EOF mark on
   your tape before attempting to label it:

<P>
<PRE>
       mt rewind
       mt weof
</PRE>
<P>
The label command can fail for a number of reasons:  

<P>

<OL>
<LI>The Volume name you specify is already in the  Volume database.  

<P>
</LI>
<LI>The Storage daemon has a tape or other Volume already mounted on the
   device, in which case you must <B>unmount</B> the device, insert a blank
   tape, then do the <B>label</B> command.

<P>
</LI>
<LI>The Volume in the device is already a Bacula labeled Volume.  (Bacula will
   never relabel a Bacula labeled Volume unless it is recycled and you use the
   <B>relabel</B> command).  

<P>
</LI>
<LI>There is no Volume in the drive.  
</LI>
</OL>

<P>
There are two ways to relabel a volume that already has a Bacula label. The
brute  force method is to write an end of file mark on the tape  using the
system <B>mt</B> program, something like the  following:  

<P>
<PRE>
       mt -f /dev/st0 rewind
       mt -f /dev/st0 weof
</PRE>
<P>
For a disk volume, you would manually delete the Volume.

<P>
Then you use the <B>label</B> command to add a new label.  However, this could
leave traces of the old volume in the  catalog.  

<P>
The preferable method to relabel a Volume is to first <B>purge</B>  the volume,
either automatically, or explicitly with the  <B>purge</B> command, then use
the <B>relabel</B> command described  below.  

<P>
If your autochanger has barcode labels, you can label all the Volumes in
your autochanger one after another by using the <B>label barcodes</B>
command.  For each tape in the changer containing a barcode, Bacula will
mount the tape and then label it with the same name as the barcode.  An
appropriate Media record will also be created in the catalog.  Any barcode
that begins with the same characters as specified on the
"CleaningPrefix=xxx" directive in the Director's Pool resource, will be
treated as a cleaning tape, and will not be labeled.  However, an entry for
the cleaning tape will be created in the catalog.  For example with:

<P>
<PRE>
        Pool {
          Name ...
          Cleaning Prefix = "CLN"
       }
</PRE>
<P>
Any slot containing a barcode of CLNxxxx will be treated as a cleaning tape
and will not be mounted.  Note, the full form of the command is:

<P>
<PRE>
label storage=xxx pool=yyy slots=1-5,10 barcodes
</PRE>
<P>
</DD>
<DT><STRONG>list</STRONG></DT>
<DD><A NAME="241"></A>
   The list command lists the requested contents of the Catalog.  The
   various fields of each record are listed on a single line.  The various
   forms of the list command are:
<PRE>
   list jobs
   
   list jobid=&lt;id&gt;           (list jobid id)

   list ujobid=&lt;unique job name&gt; (list job with unique name)
   
   list job=&lt;job-name&gt;   (list all jobs with "job-name")

   list jobname=&lt;job-name&gt;  (same as above)

       In the above, you can add "limit=nn" to limit the output to
       nn jobs.
   
   list jobmedia
   
   list jobmedia jobid=&lt;id&gt;
   
   list jobmedia job=&lt;job-name&gt;
   
   list files jobid=&lt;id&gt;
   
   list files job=&lt;job-name&gt;
   
   list pools
   
   list clients
   
   list jobtotals
   
   list volumes
   
   list volumes jobid=&lt;id&gt;
   
   list volumes pool=&lt;pool-name&gt;
   
   list volumes job=&lt;job-name&gt;
   
   list volume=&lt;volume-name&gt;  

   list nextvolume job=&lt;job-name&gt;
   
   list nextvol job=&lt;job-name&gt;

   list nextvol job=&lt;job-name&gt; days=nnn
</PRE>
<P>
What most of the above commands do should be more or less obvious.  In
   general if you do not specify all the command line arguments, the
   command will prompt you for what is needed.

<P>
The <B>list nextvol</B> command will print the Volume name to be used by
   the specified job.  You should be aware that exactly what Volume will be
   used depends on a lot of factors including the time and what a prior job
   will do.  It may fill a tape that is not full when you issue this
   command.  As a consequence, this command will give you a good estimate
   of what Volume will be used but not a definitive answer.  In addition,
   this command may have certain side effect because it runs through the
   same algorithm as a job, which means it may automatically purge or
   recycle a Volume. By default, the job specified must run within the 
   next two days or no volume will be found. You can, however, use the
   <B>days=nnn</B> specification to specify up to 50 days. For example,
   if on Friday, you want to see what Volume will be needed on Monday,
   for job MyJob, you would use <B>list nextvol job=MyJob days=3</B>.

<P>
If you wish to add specialized commands that list the contents of the
   catalog, you can do so by adding them to the <B>query.sql</B> file.
   However, this takes some knowledge of programming SQL. Please see the
   <B>query</B> command below for additional information.  See below for
   listing the full contents of a catalog record with the <B>llist</B>
   command.

<P>
As an example, the command <B>list pools</B> might produce  the following
   output: 

<P>
<PRE>
+------+---------+---------+---------+----------+-------------+
| PoId | Name    | NumVols | MaxVols | PoolType | LabelFormat |
+------+---------+---------+---------+----------+-------------+
|    1 | Default |       0 |       0 | Backup   | *           |
|    2 | Recycle |       0 |       8 | Backup   | File        |
+------+---------+---------+---------+----------+-------------+
</PRE>
<P>
As mentioned above, the <B>list</B> command lists what is in the
   database.  Some things are put into the database immediately when Bacula
   starts up, but in general, most things are put in only when they are
   first used, which is the case for a Client as with Job records, etc.

<P>
Bacula should create a client record in the database the first time you
   run a job for that client.  Doing a <B>status</B> will not cause a
   database record to be created.  The client database record will be
   created whether or not the job fails, but it must at least start.  When
   the Client is actually contacted, additional info from the client will
   be added to the client record (a "uname -a" output).

<P>
If you want to see what Client resources you have available in your conf
   file, you use the Console command <B>show clients</B>.

<P>
</DD>
<DT><STRONG>llist</STRONG></DT>
<DD><A NAME="256"></A>
   The llist or "long list" command takes all the same arguments that the
   list command described above does.  The difference is that the llist
   command list the full contents of each database record selected.  It
   does so by listing the various fields of the record vertically, with one
   field per line.  It is possible to produce a very large number of output
   lines with this command.

<P>
If instead of the <B>list pools</B> as in the example above, you enter
   <B>llist pools</B> you might get the following output:

<P>
<PRE>
          PoolId: 1
            Name: Default
         NumVols: 0
         MaxVols: 0
         UseOnce: 0
      UseCatalog: 1
 AcceptAnyVolume: 1
    VolRetention: 1,296,000
  VolUseDuration: 86,400
      MaxVolJobs: 0
     MaxVolBytes: 0
       AutoPrune: 0
         Recycle: 1
        PoolType: Backup
     LabelFormat: *

          PoolId: 2
            Name: Recycle
         NumVols: 0
         MaxVols: 8
         UseOnce: 0
      UseCatalog: 1
 AcceptAnyVolume: 1
    VolRetention: 3,600
  VolUseDuration: 3,600
      MaxVolJobs: 1
     MaxVolBytes: 0
       AutoPrune: 0
         Recycle: 1
        PoolType: Backup
     LabelFormat: File
</PRE>
<P>
</DD>
<DT><STRONG>messages</STRONG></DT>
<DD><A NAME="261"></A>
   This command causes any pending  console messages to be immediately displayed.

<P>
</DD>
<DT><STRONG>memory</STRONG></DT>
<DD><A NAME="262"></A>
   Print current memory usage.

<P>
</DD>
<DT><STRONG>mount</STRONG></DT>
<DD><A NAME="263"></A>
   The mount command is used to get Bacula to read a volume on a physical
   device.  It is a way to tell Bacula that you have mounted a tape and
   that Bacula should examine the tape.  This command is normally
   used only after there was no Volume in a drive and Bacula requests you to mount a new
   Volume or when you have specifically unmounted a Volume with the <B>   unmount</B> console command, which causes Bacula to close the drive.  If
   you have an autoloader, the mount command will not cause Bacula to
   operate the autoloader unless you specify a <B>slot</B> and possibly a
   <B>drive</B>. The various forms of the mount command are:

<P>
mount  storage=storage-name [ slot=num ] [
       drive=num ]

<P>
mount [ jobid=id |  job=job-name ]

<P>
If you have specified <B>Automatic  Mount = yes</B> in the Storage daemon's
   Device resource,  under most circumstances, Bacula will automatically access 
   the Volume unless you have explicitly <B>unmount</B>ed it in  the Console
   program. 

<P>
<A NAME="ManualPruning"></A></DD>
<DT><STRONG>prune</STRONG></DT>
<DD><A NAME="280"></A>
   The Prune command allows you to safely remove expired database records from
   Jobs, Volumes and Statistics.  This command works only on the Catalog
   database and does not affect data written to Volumes.  In all cases, the
   Prune command applies a retention period to the specified records.  You can
   Prune expired File entries from Job records; you can Prune expired Job
   records from the database, and you can Prune both expired Job and File
   records from specified Volumes.

<P>
prune files|jobs|volume|stats client=client-name 
volume=volume-name  

<P>
For a Volume to be pruned, the <B>VolStatus</B> must be Full, Used, or
   Append, otherwise the pruning will not take place.

<P>
</DD>
<DT><STRONG>purge</STRONG></DT>
<DD><A NAME="286"></A>
   The Purge command will delete associated Catalog database records from
   Jobs and Volumes without considering the retention period.  <B>Purge</B>
   works only on the Catalog database and does not affect data written to
   Volumes.  This command can be dangerous because you can delete catalog
   records associated with current backups of files, and we recommend that
   you do not use it unless you know what you are doing.  The permitted
   forms of <B>purge</B> are:

<P>
purge files jobid=jobid|job=job-name|client=client-name 

<P>
purge jobs client=client-name (of all jobs)

<P>
purge volume|volume=vol-name (of all jobs)

<P>
For the <B>purge</B> command to work on Volume Catalog database  records the
<B>VolStatus</B>  must be Append, Full, Used, or Error.  

<P>
The actual data written to the Volume will be unaffected by this command unless
you are using the <TT>ActionOnPurge=Truncate</TT> option on those Media.

<P>
To ask Bacula to truncate your <TT>Purged</TT> volumes, you need to use the
following command in interactive mode or in a RunScript:
<PRE>
*purge volume action=truncate storage=File allpools
# or by default, action=all
*purge volume action storage=File pool=Default
</PRE>

<P>
This is possible to specify the volume name, the media type, the pool, the
storage, etc...(see <TT>help purge</TT>) Be sure that your storage device is
idle when you decide to run this command.

<P>
</DD>
<DT><STRONG>python</STRONG></DT>
<DD><A NAME="306"></A>
  The python command takes a single argument <B>restart</B>:

<P>
python restart

<P>
This causes the Python interpreter in the Director to be reinitialized.
   This can be helpful for testing because once the Director starts and the
   Python interpreter is initialized, there is no other way to make it
   accept any changes to the startup script <B>DirStartUp.py</B>.  For more
   details on Python scripting, please see the Python
   ScriptingPythonChapter chapter of this manual.

<P>
</DD>
<DT><STRONG>query</STRONG></DT>
<DD><A NAME="311"></A>
   This command reads a predefined SQL query from  the query file (the name and
   location of the  query file is defined with the QueryFile resource record in 
   the Director's configuration file). You are prompted to select  a query from
   the file, and possibly enter one or more parameters,  then the command is
   submitted to the Catalog database SQL engine.  

<P>
The following queries are currently available (version 2.2.7):  

<P>
<PRE>
Available queries:
1: List up to 20 places where a File is saved regardless of the directory
2: List where the most recent copies of a file are saved
3: List last 20 Full Backups for a Client
4: List all backups for a Client after a specified time
5: List all backups for a Client
6: List Volume Attributes for a selected Volume
7: List Volumes used by selected JobId
8: List Volumes to Restore All Files
9: List Pool Attributes for a selected Pool
10: List total files/bytes by Job
11: List total files/bytes by Volume
12: List Files for a selected JobId
13: List Jobs stored on a selected MediaId
14: List Jobs stored for a given Volume name
15: List Volumes Bacula thinks are in changer
16: List Volumes likely to need replacement from age or errors
Choose a query (1-16):
</PRE>
<P>
</DD>
<DT><STRONG>quit</STRONG></DT>
<DD><A NAME="314"></A>
   This command terminates the console program. The  console program sends the
   <B>quit</B> request to the Director  and waits for acknowledgment. If the
   Director is busy doing  a previous command for you that has not terminated, it
   may  take some time. You may quit immediately by issuing the  <B>.quit</B>
   command (i.e. quit preceded by a period).  

<P>
</DD>
<DT><STRONG>relabel</STRONG></DT>
<DD><A NAME="317"></A>
   <A NAME="318"></A>
   This command is used to label physical volumes.  The full form of this
   command is:

<P>
relabel storage=storage-name oldvolume=old-volume-name  
    volume=newvolume-name 

<P>
If you leave out any part, you will be prompted for it.  In order for
   the Volume (old-volume-name) to be relabeled, it must be in the catalog,
   and the volume status must be marked <B>Purged</B> or <B>Recycle</B>.
   This happens automatically as a result of applying retention periods, or
   you may explicitly purge the volume using the <B>purge</B> command.

<P>
Once the volume is physically relabeled, the old data previously written
   on the Volume is lost and cannot be recovered.

<P>
</DD>
<DT><STRONG>release</STRONG></DT>
<DD><A NAME="328"></A>
   This command is used to cause the Storage daemon to rewind (release) the
   current tape in the drive, and to re-read the Volume label the next time
   the tape is used.

<P>
release storage=storage-name  

<P>
After a release command, the device is still kept open by Bacula (unless
   Always Open is set to No in the Storage Daemon's configuration) so it
   cannot be used by another program.  However, with some tape drives, the
   operator can remove the current tape and to insert a different one, and
   when the next Job starts, Bacula will know to re-read the tape label to
   find out what tape is mounted.  If you want to be able to use the drive
   with another program (e.g.  <B>mt</B>), you must use the <B>unmount</B>
   command to cause Bacula to completely release (close) the device.

<P>
</DD>
<DT><STRONG>reload</STRONG></DT>
<DD><A NAME="333"></A>
  The reload command causes the Director to re-read its configuration
  file and apply the new values. The new values will take effect     
  immediately for all new jobs.  However, if you change schedules,
  be aware that the scheduler pre-schedules jobs up to two hours in
  advance, so any changes that are to take place during the next two
  hours may be delayed.  Jobs that have already been scheduled to run
  (i.e. surpassed their requested start time) will continue with the
  old values.  New jobs will use the new values. Each time you issue
  a reload command while jobs are running, the prior config values   
  will queued until all jobs that were running before issuing
  the reload terminate, at which time the old config values will
  be released from memory. The Directory permits keeping up to
  ten prior set of configurations before it will refuse a reload
  command. Once at least one old set of config values has been
  released it will again accept new reload commands. 

<P>
While it is possible to reload the Director's configuration on the fly,
   even while jobs are executing, this is a complex operation and not
   without side effects.  Accordingly, if you have to reload the Director's
   configuration while Bacula is running, it is advisable to restart the
   Director at the next convenient opportunity.

<P>
<A NAME="restore_command"></A></DD>
<DT><STRONG>restore</STRONG></DT>
<DD><A NAME="335"></A>
   The restore command allows you to select one or more Jobs (JobIds) to be
   restored using various methods.  Once the JobIds are selected, the File
   records for those Jobs are placed in an internal Bacula directory tree,
   and the restore enters a file selection mode that allows you to
   interactively walk up and down the file tree selecting individual files
   to be restored.  This mode is somewhat similar to the standard Unix <B>   restore</B> program's interactive file selection mode.

<P>
restore storage=storage-name client=backup-client-name 
  where=path pool=pool-name fileset=fileset-name 
  restoreclient=restore-client-name
  select current all done  

<P>
Where <B>current</B>, if specified, tells the restore command to
   automatically select a restore to the most current backup.  If not
   specified, you will be prompted.  The <B>all</B> specification tells the
   restore command to restore all files.  If it is not specified, you will
   be prompted for the files to restore.  For details of the <B>restore</B>
   command, please see the Restore ChapterRestoreChapter of this
   manual.

<P>
The client keyword initially specifies the client from which the backup
   was made and the client to which the restore will be make.  However,
   if the restoreclient keyword is specified, then the restore is written
   to that client.

<P>
</DD>
<DT><STRONG>run</STRONG></DT>
<DD><A NAME="354"></A>
   This command allows you to schedule jobs  to be run immediately. The full form
   of the command is:

<P>
run job=job-name client=client-name
  fileset=FileSet-name  level=level-keyword
  storage=storage-name  where=directory-prefix
  when=universal-time-specification spooldata=yes|no yes

<P>
Any information that is needed but not specified will be listed for
   selection, and before starting the job, you will be prompted to accept,
   reject, or modify the parameters of the job to be run, unless you have
   specified <B>yes</B>, in which case the job will be immediately sent to
   the scheduler.

<P>
On my system, when I enter a run command, I get the following  prompt:  

<P>
<PRE>
A job name must be specified.
The defined Job resources are:
     1: Matou
     2: Polymatou
     3: Rufus
     4: Minimatou
     5: Minou
     6: PmatouVerify
     7: MatouVerify
     8: RufusVerify
     9: Watchdog
Select Job resource (1-9):
</PRE>
<P>
If I then select number 5, I am prompted with:  

<P>
<PRE>
Run Backup job
JobName:  Minou
FileSet:  Minou Full Set
Level:    Incremental
Client:   Minou
Storage:  DLTDrive
Pool:     Default
When:     2003-04-23 17:08:18
OK to run? (yes/mod/no):
</PRE>
<P>
If I now enter <B>yes</B>, the Job will be run. If I enter <B>mod</B>,  I will
be presented with the following prompt.  

<P>
<PRE>
Parameters to modify:
     1: Level
     2: Storage
     3: Job
     4: FileSet
     5: Client
     6: When
     7: Pool
Select parameter to modify (1-7):
</PRE>
<P>
If you wish to start a job at a later time, you can do so by setting  the When
time. Use the <B>mod</B> option and select <B>When</B> (no. 6).  Then enter the
desired start time in YYYY-MM-DD HH:MM:SS format.

<P>
The spooldata argument of the run command cannot be modified through the menu
and is only accessible by setting its value on the intial command line. If
no spooldata flag is set, the job, storage or schedule flag is used.

<P>
</DD>
<DT><STRONG>setdebug</STRONG></DT>
<DD><A NAME="380"></A>
   <A NAME="381"></A>
   <A NAME="382"></A>
   <A NAME="383"></A>
   <A NAME="384"></A>
   This command is used to set the debug level in each  daemon. The form of this
   command is:

<P>
setdebug level=nn [trace=0/1 client=client-name | dir | director |
  storage=storage-name | all]  

<P>
If trace=1 is set, then tracing will be enabled, and the daemon will be
   placed in trace mode, which means that all debug output as set by the
   debug level will be directed to the file <B>bacula.trace</B> in the
   current directory of the daemon.  Normally, tracing is needed only for
   Win32 clients where the debug output cannot be written to a terminal or
   redirected to a file.  When tracing, each debug output message is
   appended to the trace file.  You must explicitly delete the file when
   you are done.

<P>
</DD>
<DT><STRONG>setip</STRONG></DT>
<DD><A NAME="390"></A>
   Sets new client address - if authorized.

<P>
</DD>
<DT><STRONG>show</STRONG></DT>
<DD><A NAME="391"></A>
   <A NAME="392"></A>
   The show command will list the Director's resource records as defined in
   the Director's configuration file (normally <B>bacula-dir.conf</B>).
   This command is used mainly for debugging purposes by developers.     
   The following keywords are accepted on the
   show command line: catalogs, clients, counters, devices, directors,
   filesets, jobs, messages, pools, schedules, storages, all, help.
   Please don't confuse this command
   with the <B>list</B>, which displays the contents of the catalog.

<P>
</DD>
<DT><STRONG>sqlquery</STRONG></DT>
<DD><A NAME="395"></A>
   The sqlquery command puts the Console program into SQL query mode where
   each line you enter is concatenated to the previous line until a
   semicolon (;) is seen.  The semicolon terminates the command, which is
   then passed directly to the SQL database engine.  When the output from
   the SQL engine is displayed, the formation of a new SQL command begins.
   To terminate SQL query mode and return to the Console command prompt,
   you enter a period (.) in column 1.

<P>
Using this command, you can query the SQL catalog database directly.
   Note you should really know what you are doing otherwise you could
   damage the catalog database.  See the <B>query</B> command below for
   simpler and safer way of entering SQL queries.

<P>
Depending on what database engine you are using (MySQL, PostgreSQL or
   SQLite), you will have somewhat different SQL commands available.  For
   more detailed information, please refer to the MySQL, PostgreSQL or
   SQLite documentation.

<P>
</DD>
<DT><STRONG>status</STRONG></DT>
<DD><A NAME="397"></A>

<P>
This command will display the status of all components. For the director, it
   will display the next jobs that are scheduled during the next 24 hours as
   well as the status of currently running jobs. For the Storage Daemon, you
   will have drive status or autochanger content. The File Daemon will give you
   information about current jobs like average speed or file accounting. The
   full form of this command is:

<P>
status [all | dir=dir-name | director [days=nnn] | 
  client=client-name | [slots] storage=storage-name]

<P>
If you do a <B>status dir</B>, the console will list any currently
   running jobs, a summary of all jobs scheduled to be run in the next 24
   hours, and a listing of the last ten terminated jobs with their statuses.
   The scheduled jobs summary will include the Volume name to be used.  You
   should be aware of two things: 1. to obtain the volume name, the code
   goes through the same code that will be used when the job runs, but it
   does not do pruning nor recycling of Volumes; 2.  The Volume listed is
   at best a guess.  The Volume actually used may be different because of
   the time difference (more durations may expire when the job runs) and
   another job could completely fill the Volume requiring a new one.

<P>
In the Running Jobs listing, you may find the following types of
   information:

<P>
<PRE>
2507 Catalog MatouVerify.2004-03-13_05.05.02 is waiting execution
5349 Full    CatalogBackup.2004-03-13_01.10.00 is waiting for higher
             priority jobs to finish
5348 Differe Minou.2004-03-13_01.05.09 is waiting on max Storage jobs
5343 Full    Rufus.2004-03-13_01.05.04 is running
</PRE>
<P>
Looking at the above listing from bottom to top, obviously JobId 5343
   (Rufus) is running.  JobId 5348 (Minou) is waiting for JobId 5343 to
   finish because it is using the Storage resource, hence the "waiting on
   max Storage jobs".  JobId 5349 has a lower priority than all the other
   jobs so it is waiting for higher priority jobs to finish, and finally,
   JobId 2507 (MatouVerify) is waiting because only one job can run at a
   time, hence it is simply "waiting execution"

<P>
If you do a <B>status dir</B>, it will by default list the first
   occurrence of all jobs that are scheduled today and tomorrow.  If you
   wish to see the jobs that are scheduled in the next three days (e.g.  on
   Friday you want to see the first occurrence of what tapes are scheduled
   to be used on Friday, the weekend, and Monday), you can add the <B>   days=3</B> option.  Note, a <B>days=0</B> shows the first occurrence of jobs
   scheduled today only.  If you have multiple run statements, the first
   occurrence of each run statement for the job will be displayed for the
   period specified.

<P>
If your job seems to be blocked, you can get a general idea of the
   problem by doing a <B>status dir</B>, but you can most often get a 
   much more specific indication of the problem by doing a
   <B>status storage=xxx</B>.  For example, on an idle test system, when
   I do <B>status storage=File</B>, I get:
<PRE>
status storage=File
Connecting to Storage daemon File at 192.168.68.112:8103

rufus-sd Version: 1.39.6 (24 March 2006) i686-pc-linux-gnu redhat (Stentz)
Daemon started 26-Mar-06 11:06, 0 Jobs run since started.

Running Jobs:
No Jobs running.
====

Jobs waiting to reserve a drive:
====

Terminated Jobs:
 JobId  Level   Files          Bytes Status   Finished        Name 
======================================================================
    59  Full        234      4,417,599 OK       15-Jan-06 11:54 kernsave
====

Device status:
Autochanger "DDS-4-changer" with devices:
   "DDS-4" (/dev/nst0)
Device "DDS-4" (/dev/nst0) is mounted with Volume="TestVolume002"
Pool="*unknown*"
    Slot 2 is loaded in drive 0.
    Total Bytes Read=0 Blocks Read=0 Bytes/block=0
    Positioned at File=0 Block=0

Device "DVD-Writer" (/dev/hdc) is not open.
Device "File" (/tmp) is not open.
====

In Use Volume status:
====
</PRE>
<P>
Now, what this tells me is that no jobs are running and that none of
the devices are in use.  Now, if I <B>unmount</B> the autochanger, which
will not be used in this example, and then start a Job that uses the
File device, the job will block.  When I re-issue the status storage
command, I get for the Device status:

<P>
<PRE>
status storage=File
...
Device status:
Autochanger "DDS-4-changer" with devices:
   "DDS-4" (/dev/nst0)
Device "DDS-4" (/dev/nst0) is not open.
    Device is BLOCKED. User unmounted.
    Drive 0 is not loaded.

Device "DVD-Writer" (/dev/hdc) is not open.
Device "File" (/tmp) is not open.
    Device is BLOCKED waiting for media.
====
...
</PRE>
<P>
Now, here it should be clear that if a job were running that wanted
to use the Autochanger (with two devices), it would block because
the user unmounted the device. The real problem for the Job I started
using the "File" device is that the device is blocked waiting for
media - that is Bacula needs you to label a Volume.

<P>
</DD>
<DT><STRONG>time</STRONG></DT>
<DD><A NAME="418"></A>
   Prints the current time.

<P>
</DD>
<DT><STRONG>trace</STRONG></DT>
<DD><A NAME="419"></A>
   Turn on/off trace to file.

<P>
</DD>
<DT><STRONG>umount</STRONG></DT>
<DD><A NAME="420"></A>
   For old-time Unix guys.  See the unmount command for full details.

<P>
</DD>
<DT><STRONG>unmount</STRONG></DT>
<DD><A NAME="421"></A>
   This command causes the indicated Bacula Storage  daemon to unmount the
   specified device. The forms of the command  are the same as the mount command:
<PRE>
unmount storage=&lt;storage-name&gt; [ drive=&lt;num&gt; ]

unmount [ jobid=&lt;id&gt; | job=&lt;job-name&gt; ]
</PRE>
<P>
Once you unmount a storage device, Bacula will no longer be able to use
   it until you issue a mount command for that device. If Bacula needs to
   access that device, it will block and issue mount requests periodically
   to the operator.

<P>
If the device you are unmounting is an autochanger, it will unload
   the drive you have specified on the command line. If no drive is 
   specified, it will assume drive 1.

<P>
<A NAME="UpdateCommand"></A></DD>
<DT><STRONG>update</STRONG></DT>
<DD><A NAME="425"></A>
   This command will update the catalog for either a specific Pool record, a Volume
   record, or the Slots in an  autochanger with barcode capability. In the case
   of updating a  Pool record, the new information will be automatically taken
   from  the corresponding Director's configuration resource record. It  can be
   used to increase the maximum number of volumes permitted or  to set a maximum
   number of volumes. The following main  keywords may be specified:  
<PRE>
   media, volume, pool, slots, stats
</PRE>
<P>
In the case of updating a  Volume, you will be prompted for which value you
wish to change.  The following Volume parameters may be changed:  

<P>
<PRE>
 
   Volume Status
   Volume Retention Period
   Volume Use Duration
   Maximum Volume Jobs
   Maximum Volume Files
   Maximum Volume Bytes
   Recycle Flag
   Recycle Pool
   Slot
   InChanger Flag
   Pool
   Volume Files
   Volume from Pool
   All Volumes from Pool
   All Volumes from all Pools
</PRE>
<P>
For slots <B>update slots</B>, Bacula will obtain a list of slots and
   their barcodes from the Storage daemon, and for each barcode found, it
   will automatically update the slot in the catalog Media record to
   correspond to the new value.  This is very useful if you have moved
   cassettes in the magazine, or if you have removed the magazine and
   inserted a different one.  As the slot of each Volume is updated, the
   InChanger flag for that Volume will also be set, and any other Volumes
   in the Pool that were last mounted on the same Storage device
   will have their InChanger flag turned off.  This permits
   Bacula to know what magazine (tape holder) is currently in the
   autochanger.

<P>
If you do not have barcodes, you can accomplish the same thing in
   version 1.33 and later by using the <B>update slots scan</B> command.
   The <B>scan</B> keyword tells Bacula to physically mount each tape and to
   read its VolumeName.

<P>
For Pool <B>update pool</B>, Bacula will move the Volume record from its
   existing pool to the pool specified.

<P>
For <B>Volume from Pool</B>, <B>All Volumes from Pool</B> and <B>All Volumes
     from all Pools</B>, the following values are updated from the Pool record:
   Recycle, RecyclePool, VolRetention, VolUseDuration, MaxVolJobs, MaxVolFiles,
   and MaxVolBytes.  (RecyclePool feature is available with bacula 2.1.4 or
   higher.)

<P>
The full form of the update command with all command line arguments is:

<P>
<PRE>
       update volume=xxx pool=yyy slots volstatus=xxx VolRetention=ddd
         VolUse=ddd MaxVolJobs=nnn MaxVolBytes=nnn Recycle=yes|no
         slot=nnn enabled=n recyclepool=zzz
</PRE>
<P>
</DD>
<DT><STRONG>use</STRONG></DT>
<DD><A NAME="439"></A>
   This command allows you to specify which Catalog  database to use. Normally,
you will be using only one database so  this will be done automatically. In
the case that you are using  more than one database, you can use this command
to switch from  one to another.  

<P>
use database-name 

<P>
</DD>
<DT><STRONG>var</STRONG></DT>
<DD><A NAME="var"></A>   <A NAME="443"></A>
   This command takes a string or quoted string and  does variable expansion on
   it the same way variable expansion  is done on the <B>LabelFormat</B> string.
   Thus, for the  most part, you can test your LabelFormat strings. The
   difference  between the <B>var</B> command and the actual LabelFormat process 
   is that during the var command, no job is running so "dummy"  values are
   used in place of Job specific variables. Generally,  however, you will get a
   good idea of what is going to happen  in the real case.  

<P>
</DD>
<DT><STRONG>version</STRONG></DT>
<DD><A NAME="446"></A>
   The command prints the Director's version.  

<P>
</DD>
<DT><STRONG>wait</STRONG></DT>
<DD><A NAME="447"></A>
   The wait command causes the Director to pause  until there are no jobs
   running. This command is useful in  a batch situation such as regression
   testing where you  wish to start a job and wait until that job completes 
   before continuing. This command now has the following options:
<PRE>
   wait [jobid=nn] [jobuid=unique id] [job=job name]
</PRE>   If specified with a specific JobId, ... the wait command will wait
   for that particular job to terminate before continuing.

<P>
</DD>
</DL>

<P>
<A NAME="dotcommands"></A>
<H1><A NAME="SECTION00260000000000000000">
Special dot Commands</A>
</H1>
<A NAME="453"></A>
<A NAME="454"></A>

<P>
There is a list of commands that are prefixed with a period (.). These
commands are intended to be used either by batch programs or graphical user
interface front-ends. They are not normally used by interactive users. Once
GUI development begins, this list will be considerably expanded. The following
is the list of dot commands: 

<P>
<PRE>
.backups job=xxx      list backups for specified job
.clients              list all client names
.defaults client=xxx fileset=yyy  list defaults for specified client
.die                  cause the Director to segment fault (for debugging)
.dir                  when in tree mode prints the equivalent to the dir command,
                        but with fields separated by commas rather than spaces.
.exit                 quit
.filesets             list all fileset names
.help                 help command output
.jobs                 list all job names
.levels               list all levels
.messages             get quick messages
.msgs                 return any queued messages
.pools                list all pool names
.quit                 quit
.status               get status output
.storage              return storage resource names
.types                list job types
</PRE>
<P>
<A NAME="atcommands"></A>
<P>

<H1><A NAME="SECTION00270000000000000000">
Special At (@) Commands</A>
</H1>
<A NAME="459"></A>
<A NAME="460"></A>

<P>
Normally, all commands entered to the Console program are immediately
forwarded to the Director, which may be on another machine, to be executed.
However, there is a small list of <B>at</B> commands, all beginning with an at
character (@), that will not be sent to the Director, but rather interpreted
by the Console program directly. Note, these commands are implemented only in
the tty console program and not in the Bat Console. These commands are: 

<P>
<DL>
<DT><STRONG>@input filename</STRONG></DT>
<DD><A NAME="529"></A>
   Read and execute the commands  contained in the file specified.  

<P>
</DD>
<DT><STRONG>@output filename w/a</STRONG></DT>
<DD><A NAME="530"></A>
   Send all following output to the  filename specified either overwriting the
file (w) or appending to  the file (a). To redirect the output to the
terminal, simply enter  <B>@output</B> without a filename specification.
WARNING: be careful  not to overwrite a valid file. A typical example during a
regression  test might be:  

<P>
<PRE>
    @output /dev/null
    commands ...
    @output
</PRE>
<P>
</DD>
<DT><STRONG>@tee filename w/a</STRONG></DT>
<DD><A NAME="531"></A>
   Send all subsequent output to  both the specified file and the terminal. It is
   turned off by  specifying <B>@tee</B> or <B>@output</B> without a filename.  

<P>
</DD>
<DT><STRONG>@sleep seconds</STRONG></DT>
<DD><A NAME="532"></A>
   Sleep the specified number of seconds.  

<P>
</DD>
<DT><STRONG>@time</STRONG></DT>
<DD><A NAME="484"></A>
   Print the current time and date.  

<P>
</DD>
<DT><STRONG>@version</STRONG></DT>
<DD><A NAME="485"></A>
   Print the console's version.  

<P>
</DD>
<DT><STRONG>@quit</STRONG></DT>
<DD><A NAME="486"></A>
   quit  

<P>
</DD>
<DT><STRONG>@exit</STRONG></DT>
<DD><A NAME="487"></A>
   quit  

<P>
</DD>
<DT><STRONG>@# anything</STRONG></DT>
<DD><A NAME="488"></A>
   Comment 

<P>
</DD>
<DT><STRONG>@help</STRONG></DT>
<DD><A NAME="489"></A>
   Get the list of every special @ commands.

<P>
</DD>
<DT><STRONG>@separator char</STRONG></DT>
<DD><A NAME="492"></A> 
  When using bconsole with readline, you can set the command separator to one
  of those characters to write commands who require multiple input on one line,
  or to put multiple commands on a single line.
<PRE>
  !$%&amp;'()*+,-/:;&lt;&gt;?[]^`{|}~
</PRE>

<P>
Note, if you use a semicolon (;) as a separator character, which is
  common, you will not be able to use the <B>sql</B> command, which 
  requires each command to be terminated by a semicolon.

<P>
</DD>
</DL>

<P>
<A NAME="scripting"></A>
<H1><A NAME="SECTION00280000000000000000">
Running the Console from a Shell Script</A>
</H1>
<A NAME="499"></A>
<A NAME="500"></A>

<P>
You can automate many Console tasks by running the console program from a
shell script. For example, if you have created a file containing the following
commands: 

<P>
<PRE>
 ./bconsole -c ./bconsole.conf &lt;&lt;END_OF_DATA
 unmount storage=DDS-4
 quit
 END_OF_DATA
</PRE>
<P>
when that file is executed, it will unmount the current DDS-4 storage device.
You might want to run this command during a Job by using the <B>RunBeforeJob</B> or <B>RunAfterJob</B> records. 

<P>
It is also possible to run the Console program from file input where the file
contains the commands as follows: 

<P>
<PRE>
./bconsole -c ./bconsole.conf &lt;filename
</PRE>
<P>
where the file named <B>filename</B> contains any set of console commands. 

<P>
As a real example, the following script is part of the Bacula regression
tests. It labels a volume (a disk volume), runs a backup, then does a restore
of the files saved. 

<P>
<PRE>
bin/bconsole -c bin/bconsole.conf &lt;&lt;END_OF_DATA
@output /dev/null
messages
@output /tmp/log1.out
label volume=TestVolume001
run job=Client1 yes
wait
messages
@#
@# now do a restore
@#
@output /tmp/log2.out
restore current all
yes
wait
messages
@output
quit
END_OF_DATA
</PRE>
<P>
The output from the backup is directed to /tmp/log1.out and the output from
the restore is directed to /tmp/log2.out. To ensure that the backup and
restore ran correctly, the output files are checked with: 

<P>
<PRE>
grep "^Termination: *Backup OK" /tmp/log1.out
backupstat=$?
grep "^Termination: *Restore OK" /tmp/log2.out
restorestat=$?
</PRE>
<P>

<H1><A NAME="SECTION00290000000000000000">
Adding Volumes to a Pool</A>
</H1>
<A NAME="513"></A>
<A NAME="514"></A>

<P>
If you have used the <B>label</B> command to label a Volume, it will be
automatically added to the Pool, and you will not need to add any media to the
pool. 

<P>
Alternatively, you may choose to add a number of Volumes to the pool without
labeling them. At a later time when the Volume is requested by <B>Bacula</B>
you will need to label it. 

<P>
Before adding a volume, you must know the following information: 

<P>

<OL>
<LI>The name of the Pool (normally "Default")  
</LI>
<LI>The Media Type as specified in the Storage Resource  in the Director's
   configuration file (e.g. "DLT8000")  
</LI>
<LI>The number and names of the Volumes you wish to create. 
</LI>
</OL>

<P>
For example, to add media to a Pool, you would issue the following commands to
the console program: 

<P>
<PRE>
*add
Enter name of Pool to add Volumes to: Default
Enter the Media Type: DLT8000
Enter number of Media volumes to create. Max=1000: 10
Enter base volume name: Save
Enter the starting number: 1
10 Volumes created in pool Default
*
</PRE>
<P>
To see what you have added, enter: 

<P>
<PRE>
*list media pool=Default
+-------+----------+---------+---------+-------+------------------+
| MedId | VolumeNa | MediaTyp| VolStat | Bytes | LastWritten      |
+-------+----------+---------+---------+-------+------------------+
|    11 | Save0001 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    12 | Save0002 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    13 | Save0003 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    14 | Save0004 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    15 | Save0005 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    16 | Save0006 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    17 | Save0007 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    18 | Save0008 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    19 | Save0009 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
|    20 | Save0010 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
+-------+----------+---------+---------+-------+------------------+
*
</PRE>
<P>
Notice that the console program automatically appended a number to the base
Volume name that you specify (Save in this case). If you don't want it to
append a number, you can simply answer 0 (zero) to the question "Enter number
of Media volumes to create. Max=1000:", and in this case, it will create a
single Volume with the exact name you specify. 
<IMG
 WIDTH="978" HEIGHT="1265" BORDER="0"
 SRC="img2.png"
 ALT="\begin{figure}\vbox{\include{gui}
}\end{figure}">

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html58"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html52"
  HREF="Bacula_Console_Operators_Gu.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html46"
  HREF="Contents.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html54"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html56"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html59"
  HREF="GNU_Free_Documentation_Lice.html">GNU Free Documentation License</A>
<B> Up:</B> <A NAME="tex2html53"
  HREF="Bacula_Console_Operators_Gu.html">Bacula Console and Operators</A>
<B> Previous:</B> <A NAME="tex2html47"
  HREF="Contents.html">Contents</A>
 &nbsp; <B>  <A NAME="tex2html55"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html57"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

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