]> git.sur5r.net Git - bacula/docs/blobdiff - docs/manuals/en/console/bconsole.tex
Tweaks from Dan
[bacula/docs] / docs / manuals / en / console / bconsole.tex
index 3fc5ee440749135fbd6daae59e783816a5f4517d..8861a22cbb7e6989b6cc84632a3c0132d3bc076d 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 \ilink{Console Configuration
+File}{ConsoleConfChapter} Chapter of this document.
 
 \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
@@ -334,8 +329,13 @@ The following commands are currently implemented:
    you to choose one.
 
    Once a Job is marked to be canceled, it may take a bit of time
-   (generally within a minute) before it actually terminates, depending on
-   what operations it is doing.
+   (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.
+
 
 \item [{create [pool=\lt{}pool-name\gt{}]}]
    \index[general]{create pool}
@@ -433,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.
  
 
@@ -471,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}
@@ -600,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>
@@ -741,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]
@@ -765,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}
@@ -814,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 \ilink{Python
+   Scripting}{PythonChapter} chapter of this manual.
+
+\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}
@@ -912,7 +985,7 @@ restore storage=\lt{}storage-name\gt{} client=\lt{}backup-client-name\gt{}
 run job=\lt{}job-name\gt{} client=\lt{}client-name\gt{}
   fileset=\lt{}FileSet-name\gt{}  level=\lt{}level-keyword\gt{}
   storage=\lt{}storage-name\gt{}  where=\lt{}directory-prefix\gt{}
-  when=\lt{}universal-time-specification\gt{}  yes  
+  when=\lt{}universal-time-specification\gt{} spooldata=yes|no yes
 
    Any information that is needed but not specified will be listed for
    selection, and before starting the job, you will be prompted to accept,
@@ -977,7 +1050,17 @@ Select parameter to modify (1-7):
 
 If you wish to start a job at a later time, you can do so by setting  the When
 time. Use the {\bf mod} option and select {\bf When} (no. 6).  Then enter the
-desired start time in YYYY-MM-DD HH:MM:SS format.  
+desired start time in YYYY-MM-DD HH:MM:SS format.
+
+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}
@@ -1000,6 +1083,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}
@@ -1034,13 +1132,16 @@ setdebug level=nn [trace=0/1 client=\lt{}client-name\gt{} | dir | director |
 
 \item [status]
    \index[general]{status}
-   This command will display the status of the next jobs that are scheduled
-   during the next 24 hours as well as the status of currently
-   running jobs.  The full form of this command is:
 
-status [all | dir=\lt{}dir-name\gt{} | director | 
-  client=\lt{}client-name\gt{} | storage=\lt{}storage-name\gt{} |
-  days=nnn]
+   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:
+
+status [all | dir=\lt{}dir-name\gt{} | director [days=nnn] | 
+  client=\lt{}client-name\gt{} | [slots] storage=\lt{}storage-name\gt{}]
 
    If you do a {\bf status dir}, the console will list any currently
    running jobs, a summary of all jobs scheduled to be run in the next 24
@@ -1160,6 +1261,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
@@ -1192,7 +1305,7 @@ unmount [ jobid=<id> | job=<job-name> ]
    number of volumes. The following main  keywords may be specified:  
 \footnotesize
 \begin{verbatim}
-   media, volume, pool, slots  
+   media, volume, pool, slots, stats
 \end{verbatim}
 \normalsize
 
@@ -1265,7 +1378,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}
@@ -1282,51 +1400,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
@@ -1388,7 +1461,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}
 
@@ -1441,10 +1514,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}
@@ -1511,9 +1601,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