]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manuals/en/console/bconsole.tex
Commit two patches from Philippe to cleanup the manuals
[bacula/docs] / docs / manuals / en / console / bconsole.tex
index d55e2fd6e8519840342b0b50399c450a1c0c8026..6870a6e04ddfe4bf99eb49c8c301f0a4fdf5a760 100644 (file)
@@ -13,15 +13,10 @@ allows the user or the System Administrator, to interact with the Bacula
 Director daemon while the daemon is running. 
 
 The current Bacula Console comes in two versions: a shell interface (TTY
-style), and a GNOME GUI interface. 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. 
-
-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.
+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.
 
 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
@@ -38,14 +33,15 @@ indicates that the new tape is mounted.
 \index[general]{Console Configuration}
 \index[general]{Configuration!Console}
 
-When the Console starts, it reads a standard Bacula configuration file named
-{\bf bconsole.conf} or {\bf bgnome-console.conf} in the case of the GNOME
-Console version. 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 
-\ilink{Console Configuration File}{ConsoleConfChapter} Chapter of
-this document. 
+When the Console starts, it reads a standard Bacula configuration file
+named {\bf bconsole.conf} or {\bf bat.conf} in the case of the Bat
+QT Console version from the current directory unless you specify the {\bf {-}c}
+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 \borgxrlink{Console Configuration}{ConsoleConfChapter}
+{main}{chapter} of the \mainman{}.
 
 \section{Running the Console Program}
 \index[general]{Running the Console Program}
@@ -61,19 +57,18 @@ Usage: bconsole [-s] [-c config_file] [-d debug_level]
        -dnn        set debug level to nn
        -n          no conio
        -s          no signals
+       -u <nn>     set command execution timeout to <nn> seconds
        -t          test - read configuration and exit
        -?          print this message.
 \end{verbatim}
 \normalsize
 
 
-After launching the Console program (bconsole), it will prompt you for the
-next command with an asterisk (*). (Note, in the GNOME version, the prompt is
-not present; you simply enter the commands you want in the command text box at
-the bottom of the screen.) 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: 
+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:
 
 \footnotesize
 \begin{verbatim}
@@ -249,6 +244,8 @@ order ...
   Used in the show, list, and llist commands. Takes no arguments.
 \item [select]
   Used in the restore command. Takes no argument.
+\item[limit]
+  Used in the setbandwidth command. Takes integer in KB/s unit.
 \item [storages]
   Used in the show command. Takes no arguments.
 \item [schedules]
@@ -309,9 +306,7 @@ The following commands are currently implemented:
    auto-display of messages on or off respectively.  The default for the
    console program is {\bf off}, which means that you will be notified when
    there are console messages pending, but they will not automatically be
-   displayed.  The default for the bgnome-console program is {\bf on}, which
-   means that messages will be displayed when they are received (usually
-   within five seconds of them being generated).
+   displayed.
 
    When autodisplay is turned off, you must explicitly retrieve the
    messages with the {\bf messages} command.  When autodisplay is turned
@@ -438,20 +433,23 @@ delete Job JobId=n,m,o-r,t ...
    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.
+   larger than an actual backup. 
+
+   The \texttt{estimate} command can use the accurate code to detect changes
+   and give a better estimation. You can set the accurate behavior on command
+   line using \texttt{accurate=yes/no} or use the Job setting as default value.
 
    Optionally you may specify the keyword {\bf listing} 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:  
 
-
 \begin{verbatim}
-estimate job=<job-name> listing client=<client-name> 
+estimate job=<job-name> listing client=<client-name> accurate=<yes/no>
        fileset=<fileset-name> level=<level-name>  
 \end{verbatim}
 
-   Specification of the {\bf job} is sufficient, but you can also override
-   the client, fileset and/or level by specifying them on the estimate
+   Specification of the {\bf job} is sufficient, but you can also override the
+   client, fileset, accurate and/or level by specifying them on the estimate
    command line.
  
 
@@ -476,6 +474,16 @@ As an example, you might do:
    There is currently no way to get an estimate of the real file size that 
    would be found should the sparse option be enabled.
                                    
+\item [exit]
+   \index[general]{exit}
+   This command terminates the console program.  
+
+\item [gui]
+   \index[general]{gui}
+   Invoke the non-interactive gui mode.
+\begin{verbatim}
+gui [on|off]
+\end{verbatim}
 
 \item [help]
    \index[general]{help}
@@ -605,6 +613,8 @@ label storage=xxx pool=yyy slots=1-5,10 barcodes
        In the above, you can add "limit=nn" to limit the output to
        nn jobs.
    
+   list joblog jobid=<id> (list job output if recorded in the catalog)
+
    list jobmedia
    
    list jobmedia jobid=<id>
@@ -746,6 +756,10 @@ label storage=xxx pool=yyy slots=1-5,10 barcodes
 \item [messages]
    \index[general]{messages}
    This command causes any pending  console messages to be immediately displayed.
+
+\item [memory]
+   \index[general]{memory}
+   Print current memory usage.
  
 
 \item [mount]
@@ -770,19 +784,6 @@ mount [ jobid=\lt{}id\gt{} |  job=\lt{}job-name\gt{} ]
    the Volume unless you have explicitly {\bf unmount}ed it in  the Console
    program. 
 
-\item[python]
-   \index[general]{python}
-  The python command takes a single argument {\bf restart}:
-
-python restart
-
-   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 {\bf DirStartUp.py}.  For more
-   details on Python scripting, please see the \ilink{Python
-   Scripting}{PythonChapter} chapter of this manual.
-
 \label{ManualPruning}
 \item [prune]
    \index[general]{prune}
@@ -819,7 +820,74 @@ purge volume|volume=\lt{}vol-name\gt{} (of all jobs)
 For the {\bf purge} command to work on Volume Catalog database  records the
 {\bf VolStatus}  must be Append, Full, Used, or Error.  
 
-The actual data written to the Volume will be unaffected by  this command.  
+The actual data written to the Volume will be unaffected by this command unless
+you are using the \texttt{ActionOnPurge=Truncate} option on those Media.
+
+To ask Bacula to truncate your \texttt{Purged} volumes, you need to use the
+following command in interactive mode or in a RunScript:
+\begin{verbatim}
+*purge volume action=truncate storage=File allpools
+# or by default, action=all
+*purge volume action storage=File pool=Default
+\end{verbatim}
+
+This is possible to specify the volume name, the media type, the pool, the
+storage, etc\dots (see \texttt{help purge}) Be sure that your storage device is
+idle when you decide to run this command.
+
+\item[python]
+   \index[general]{python}
+  The python command takes a single argument {\bf restart}:
+
+python restart
+
+   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 {\bf DirStartUp.py}.  For more
+   details on Python scripting, please see the \borgxrlink{Python Scripting}
+   {PythonChapter}{misc}{chapter} of the \miscman{}.
+
+\item [query]
+   \index[general]{query}
+   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.  
+
+The following queries are currently available (version 2.2.7):  
+
+\footnotesize
+\begin{verbatim}
+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):
+\end{verbatim}
+\normalsize
+
+\item [quit]
+   \index[general]{quit}
+   This command terminates the console program. The  console program sends the
+   {\bf quit} 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  {\bf .quit}
+   command (i.e. quit preceded by a period).  
 
 \item [relabel]
    \index[general]{relabel}
@@ -894,6 +962,7 @@ release storage=\lt{}storage-name\gt{}
 restore storage=\lt{}storage-name\gt{} client=\lt{}backup-client-name\gt{} 
   where=\lt{}path\gt{} pool=\lt{}pool-name\gt{} fileset=\lt{}fileset-name\gt{} 
   restoreclient=\lt{}restore-client-name\gt{}
+  restorejob=\lt{}job-name\gt{}
   select current all done  
 
    Where {\bf current}, if specified, tells the restore command to
@@ -901,14 +970,20 @@ restore storage=\lt{}storage-name\gt{} client=\lt{}backup-client-name\gt{}
    specified, you will be prompted.  The {\bf all} 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 {\bf restore}
-   command, please see the \ilink{Restore Chapter}{RestoreChapter} of this
-   manual.
+   command, please see the \borgxrlink{Restore}{RestoreChapter}{main}{chapter}
+   of the \mainman{}.
 
    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.
 
+   The restore job rarely needs to be specified, as bacula installations
+   commonly only have a single restore job configured. However, for certain
+   cases, such as a varying list of RunScript specifications, multiple
+   restore jobs may be configured. The restorejob argument allows the
+   selection of one of these jobs.
+
 \item [run]
    \index[general]{run}
    This command allows you to schedule jobs  to be run immediately. The full form
@@ -988,6 +1063,12 @@ 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.
 
+\item[setbandwidth] 
+  \index[general]{setbandwidth}
+  This command is used to limit the bandwidth of a running job or a client.
+
+setbandwidth limit=<nb> [ jobid=<id> | client=<cli> ]
+
 \item [setdebug]
    \index[general]{setdebug}
    \index[general]{setdebug}
@@ -1009,6 +1090,21 @@ setdebug level=nn [trace=0/1 client=\lt{}client-name\gt{} | dir | director |
    appended to the trace file.  You must explicitly delete the file when
    you are done.
 
+\item [setip]
+   \index[general]{setip}
+   Sets new client address -- if authorized.
+
+   A console is authorized to use the {\bf SetIP} command only if it has a
+   Console resource definition in both the Director and the Console.  In
+   addition, if the console name, provided on the {\bf Name =} directive,
+   must be the same as a Client name, the user of that console is permitted
+   to use the {\bf SetIP} 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.
+
+
+
 \item [show]
    \index[general]{show}
    \index[general]{show}
@@ -1172,6 +1268,18 @@ 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.
 
+\item [time]
+   \index[general]{time}
+   Prints the current time.
+
+\item [trace]
+   \index[general]{trace}
+   Turn on/off trace to file.
+
+\item [umount]
+   \index[general]{umount}
+   For old-time Unix guys.  See the unmount command for full details.
+
 \item [unmount]
    \index[general]{unmount}
    This command causes the indicated Bacula Storage  daemon to unmount the
@@ -1277,7 +1385,12 @@ 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.  
 
-use \lt{}database-name\gt{} 
+\footnotesize
+\begin{verbatim}
+       use [catalog=name-of-catalog]
+\end{verbatim}
+\normalsize
+
 
 \item [var]
    \label{var}
@@ -1294,51 +1407,6 @@ use \lt{}database-name\gt{}
    \index[general]{version}
    The command prints the Director's version.  
 
-\item [quit]
-   \index[general]{quit}
-   This command terminates the console program. The  console program sends the
-   {\bf quit} 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  {\bf .quit}
-   command (i.e. quit preceded by a period).  
-
-\item [query]
-   \index[general]{query}
-   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.  
-
-The following queries are currently available (version 2.2.7):  
-
-\footnotesize
-\begin{verbatim}
-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):
-\end{verbatim}
-\normalsize
-
-\item [exit]
-   \index[general]{exit}
-   This command terminates the console program.  
-
 \item [wait]
    \index[general]{wait}
    The wait command causes the Director to pause  until there are no jobs
@@ -1400,7 +1468,7 @@ forwarded to the Director, which may be on another machine, to be executed.
 However, there is a small list of {\bf at} 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 GNOME Console. These commands are: 
+the tty console program and not in the Bat Console. These commands are: 
 
 \begin{description}
 
@@ -1453,10 +1521,27 @@ regression  test might be:
 \item [@\# anything]
    \index[general]{anything}
    Comment 
+
+\item [@help]
+   \index[general]{@help}
+   Get the list of every special @ commands.
+
+\item [@separator \lt{}char\gt{}]
+\index[general]{@separator} 
+  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.
+\begin{verbatim}
+  !$%&'()*+,-/:;<>?[]^`{|}~
+\end{verbatim}
+
+  Note, if you use a semicolon (;) as a separator character, which is
+  common, you will not be able to use the {\bf sql} command, which 
+  requires each command to be terminated by a semicolon.
+
 \end{description}
 
 \label{scripting}
-
 \section{Running the Console from a Shell Script}
 \index[general]{Script!Running the Console Program from a Shell}
 \index[general]{Running the Console Program from a Shell Script}
@@ -1523,9 +1608,9 @@ restore ran correctly, the output files are checked with:
 
 \footnotesize
 \begin{verbatim}
-grep "^Termination: *Backup OK" /tmp/log1.out
+grep "^ *Termination: *Backup OK" /tmp/log1.out
 backupstat=$?
-grep "^Termination: *Restore OK" /tmp/log2.out
+grep "^ *Termination: *Restore OK" /tmp/log2.out
 restorestat=$?
 \end{verbatim}
 \normalsize