%%
%%
-\section*{Bacula Console}
+\chapter{Bacula Console}
\label{_ConsoleChapter}
-\index[general]{Console!Bacula }
-\index[general]{Bacula Console }
-\index[console]{Console!Bacula }
-\index[console]{Bacula Console }
-\addcontentsline{toc}{section}{Bacula Console}
+\index[general]{Console!Bacula}
+\index[general]{Bacula Console}
+\index[console]{Console!Bacula}
+\index[console]{Bacula Console}
-\subsection*{General}
-\index[general]{General}
-\addcontentsline{toc}{subsection}{General}
+Die {\bf Bacula Console} (manchmal auch die Benutzerschnittstelle genannt)
+ist ein Programm das es dem Anwender oder System Aministrator erlaub,
+den Bacula-Director-Dienst zu steuern, w\"{a}hrend er l\"{a}uft.
-The {\bf Bacula Console} (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.
+Momentan gibt es zwei Versionen des Console-Programms: eine Shell- (TTY)
+und eine GNOME GUI-Version. Beide erlauben es dem Administrator oder
+autorisierten Benutzern Bacula zu steuern.
The current Bacula Console comes in two versions: a shell interface (TTY
style), and a GNOME GUI interface. Both permit the administrator or authorized
job, examine the contents of the Catalog as well as perform certain tape
manipulations with the Console program.
-In addition, there is a wx-console built with wxWidgets that allows a graphic
+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.
+but it already is quite useful. Unfortunately, it has not been enhanced for
+some time now.
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
requests a new tape, it waits until the user, via the Console program,
indicates that the new tape is mounted.
-\subsection*{Console Configuration}
+\section{Console Configuration}
\index[general]{Console Configuration}
\index[general]{Configuration!Console}
\index[console]{Console Configuration}
\index[console]{Configuration!Console}
-\addcontentsline{toc}{subsection}{Console Configuration}
When the Console starts, it reads a standard Bacula configuration file named
-{\bf bconsole.conf} or {\bf gnome-console.conf} in the case of the GNOME
+{\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}{_ChapterStart36} Chapter of
+\ilink{Console Configuration File}{ConsoleConfChapter} Chapter of
this document.
-\subsection*{Running the Console Program}
-\index[general]{Running the Console Program }
-\index[general]{Program!Running the Console }
-\index[console]{Running the Console Program }
-\index[console]{Program!Running the Console }
-\addcontentsline{toc}{subsection}{Running the Console Program}
+\section{Running the Console Program}
+\index[general]{Running the Console Program}
+\index[general]{Program!Running the Console}
+\index[console]{Running the Console Program}
+\index[console]{Program!Running the Console}
+
+The console program can be run with the following options:
+\footnotesize
+\begin{verbatim}
+Usage: bconsole [-s] [-c config_file] [-d debug_level]
+ -c <file> set configuration file to file
+ -dnn set debug level to nn
+ -n no conio
+ -s no signals
+ -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
will display all the Pool resource records.
-\subsection*{Stopping the Console Program}
-\index[general]{Program!Stopping the Console }
-\index[general]{Stopping the Console Program }
-\index[console]{Program!Stopping the Console }
-\index[console]{Stopping the Console Program }
-\addcontentsline{toc}{subsection}{Stopping the Console Program}
+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.
+
+\section{Stopping the Console Program}
+\index[general]{Program!Stopping the Console}
+\index[general]{Stopping the Console Program}
+\index[console]{Program!Stopping the Console}
+\index[console]{Stopping the Console Program}
Normally, you simply enter {\bf quit} or {\bf exit} and the Console program
will terminate. However, it waits until the Director acknowledges the command.
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.
-\label{list}
-\subsection*{Alphabetic List of Console Commands}
-\index[general]{Commands!Alphabetic List of Console }
-\index[general]{Alphabetic List of Console Commands }
-\index[console]{Commands!Alphabetic List of Console }
-\index[console]{Alphabetic List of Console Commands }
-\addcontentsline{toc}{subsection}{Alphabetic List of Console Commands}
+\label{keywords}
+\section{Alphabetic List of Console Keywords}
+\index[general]{Keywords!Alphabetic List of Console}
+\index[general]{Alphabetic List of Console Keywords}
+\index[console]{Keywords!Alphabetic List of Console}
+\index[console]{Alphabetic List of Console Keywords}
+Unless otherwise specified, each of the following keywords
+takes an argument, which is specified after the keyword following
+an equal sign. For example:
+
+\begin{verbatim}
+jobid=536
+\end{verbatim}
+
+Please note, this list is incomplete as it is currently in
+the process of being created and is not currently totally in
+alphabetic
+order ...
+
+\begin{description}
+\item [restart]
+ Permitted on the python command, and causes the Python
+ interpreter to be restarted. Takes no argument.
+\item [all]
+ Permitted on the status and show commands to specify all components or
+ resources respectively.
+\item [allfrompool]
+ Permitted on the update command to specify that all Volumes in the
+ pool (specified on the command line) should be updated.
+\item [allfrompools]
+ Permitted on the update command to specify that all Volumes in all
+ pools should be updated.
+\item [before]
+ Used in the restore command.
+\item [bootstrap]
+ Used in the restore command.
+\item [catalog]
+ Allowed in the use command to specify the catalog name
+ to be used.
+\item [catalogs]
+ Used in the show command. Takes no arguments.
+\item [client | fd]
+\item [clients]
+ Used in the show, list, and llist commands. Takes no arguments.
+\item [counters]
+ Used in the show command. Takes no arguments.
+\item [current]
+ Used in the restore command. Takes no argument.
+\item [days]
+ 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.
+\item [devices]
+ Used in the show command. Takes no arguments.
+\item [dir | director]
+\item [directors]
+ Used in the show command. Takes no arguments.
+\item [directory]
+ Used in the restore command. Its argument specifies the directory
+ to be restored.
+\item [enabled]
+ This keyword can appear on the {\bf update volume} as well
+ as the {\bf update slots} 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.
+\item [done]
+ Used in the restore command. Takes no argument.
+\item [file]
+ Used in the restore command.
+\item [files]
+ Used in the list and llist commands. Takes no arguments.
+\item [fileset]
+\item [filesets]
+ Used in the show command. Takes no arguments.
+\item [help]
+ Used in the show command. Takes no arguments.
+\item [jobs]
+ Used in the show, list and llist commands. Takes no arguments.
+\item [jobmedia]
+ Used in the list and llist commands. Takes no arguments.
+\item [jobtotals]
+ Used in the list and llist commands. Takes no arguments.
+\item [jobid]
+ 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.
+\item [job | jobname]
+ 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.
+\item [level]
+\item [listing]
+ Permitted on the estimate command. Takes no argument.
+\item [limit]
+\item [messages]
+ Used in the show command. Takes no arguments.
+\item [media]
+ Used in the list and llist commands. Takes no arguments.
+\item [nextvol | nextvolume]
+ Used in the list and llist commands. Takes no arguments.
+\item [on]
+ Takes no keyword.
+\item [off]
+ Takes no keyword.
+\item [pool]
+\item [pools]
+ Used in the show, list, and llist commands. Takes no arguments.
+\item [select]
+ Used in the restore command. Takes no argument.
+\item [storages]
+ Used in the show command. Takes no arguments.
+\item [schedules]
+ Used in the show command. Takes no arguments.
+\item [sd | store | storage]
+\item [ujobid]
+ 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.
+\item [volume]
+\item [volumes]
+ Used in the list and llist commands. Takes no arguments.
+\item [where]
+ Used in the restore command.
+\item [yes]
+ Used in the restore command. Takes no argument.
+\end{description}
+
+\label{list}
+\section{Alphabetic List of Console Commands}
+\index[general]{Commands!Alphabetic List of Console}
+\index[general]{Alphabetic List of Console Commands}
+\index[console]{Commands!Alphabetic List of Console}
+\index[console]{Alphabetic List of Console Commands}
The following commands are currently implemented:
\item [{add [pool=\lt{}pool-name\gt{} storage=\lt{}storage\gt{}
jobid=\lt{}JobId\gt{}]} ]
\index[console]{add}
-This command is used to add Volumes to an existing Pool. The Volume names
-entered are placed in the Catalog and thus become available for backup
-operations. Normally, the {\bf label} command is used rather than this
-command because the {\bf label} command labels the physical media (tape) and
-does the equivalent of the {\bf add} command. This 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 {\bf label} 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 {\bf label}
-command below for the list of legal characters in a Volume name.
+ 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.
+
+ Normally, the {\bf label} command is used rather than this command
+ because the {\bf label} command labels the physical media (tape, disk,
+ DVD, ...) and does the equivalent of the {\bf add} command. The {\bf
+ add} 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 {\bf label} 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 {\bf label} command
+ below for the list of legal characters in a Volume name.
\item [autodisplay on/off]
\index[console]{autodisplay on/off}
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 gnome-console program is {\bf on}, which
+ displayed. The default for the bgnome-console program is {\bf on}, which
means that messages will be displayed when they are received (usually
- within 5 seconds of them being generated).
+ within five seconds of them being generated).
When autodisplay is turned off, you must explicitly retrieve the
messages with the {\bf messages} command. When autodisplay is turned
\item [automount on/off]
\index[console]{automount on/off}
This command accepts {\bf on} or {\bf off} as the argument, and turns
- auto-mounting of the tape after a {\bf label} command on or off
+ auto-mounting of the Volume after a {\bf label} command on or off
respectively. The default is {\bf on}. If {\bf automount} is turned
- off, you must explicitly {\bf mount} the tape after a label command to
+ off, you must explicitly {\bf mount} tape Volumes after a label command to
use it.
-\item [{cancel [jobid=\lt{}number\gt{} job=\lt{}job-name\gt{}]}]
+\item [{cancel [jobid=\lt{}number\gt{} job=\lt{}job-name\gt{} ujobid=\lt{}unique-jobid\gt{}]}]
\index[console]{cancel jobid}
This command is used to cancel a job and accepts {\bf jobid=nnn} or {\bf
job=xxx} as an argument where nnn is replaced by the JobId and xxx is
(generally within a minute) before it actually terminates, depending on
what operations it is doing.
-\item [{ create [pool=\lt{}pool-name\gt{}]}]
+\item [{create [pool=\lt{}pool-name\gt{}]}]
\index[console]{create pool}
- This command is used to create a Pool record in the database using the
+ 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
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.
-\item [{ delete [volume=\lt{}vol-name\gt{} pool=\lt{}pool-name\gt{} job
- jobid=\lt{}id\gt{}] }]
+\item [{delete [volume=\lt{}vol-name\gt{} pool=\lt{}pool-name\gt{} job
+ jobid=\lt{}id\gt{}]}]
\index[console]{delete}
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
records (File and JobMedia) will be deleted from the catalog. The full
form of this command is:
-delete pool=\lt{}pool-name\gt{}
+\begin{verbatim}
+delete pool=<pool-name>
+\end{verbatim}
or
-delete volume=\lt{}volume-name\gt{} pool=\lt{}pool-name\gt{} or
+\begin{verbatim}
+delete volume=>volume-name> pool=>pool-name> or
+\end{verbatim}
-delete JobId=\lt{}job-id\gt{} JobId=\lt{}job-id2\gt{} ... or
+\begin{verbatim}
+delete JobId=>job-id> JobId=>job-id2> ... or
+\end{verbatim}
+\begin{verbatim}
delete Job JobId=n,m,o-r,t ...
+\end{verbatim}
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.
+ 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.
+
+\item [disable job\lt{}job-name\gt{}]
+ \index[console]{enable}
+ This command permits you to disable a Job for automatic scheduling.
+ The job may have been previously enabled with the Job resource
+ {\bf Enabled} directive or using the console {\bf enable} 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.
+
+\item [enable job\lt{}job-name\gt{}]
+ \index[console]{enable}
+ This command permits you to enable a Job for automatic scheduling.
+ The job may have been previously disabled with the Job resource
+ {\bf Enabled} directive or using the console {\bf disable} 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.
\label{estimate}
\item [estimate]
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:
-estimate job=\lt{}job-name\gt{} listing client=\lt{}client-name\gt{}
-fileset=\lt{}fileset-name\gt{} level=\lt{}level-name\gt{}
+
+\begin{verbatim}
+estimate job=<job-name> listing client=<client-name>
+ 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
\end{verbatim}
\normalsize
-which will do a full listing of all files to be backed up for the Job {\bf
-NightlySave} during an Incremental save and put it in the file {\bf
-/tmp/listing}.
+ which will do a full listing of all files to be backed up for the Job {\bf
+ NightlySave} during an Incremental save and put it in the file {\bf
+ /tmp/listing}. 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.
+
\item [help]
\index[console]{help}
This command is used to label physical volumes. The full form of this command
is:
-label storage=\lt{}storage-name\gt{} volume=\lt{}volume-name\gt{}
-slot=\lt{}slot\gt{}
+\begin{verbatim}
+label storage=>storage-name> volume=>volume-name>
+ slot=>slot>
+\end{verbatim}
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 tape be
- labeled. If the tape labeling is successful, the Console program will
+ 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.
The Volume name is restricted to letters, numbers, and the special
characters hyphen ({\bf -}), underscore ({\bf \_}), colon ({\bf :}), and
- period ({\bf .}). All other characters including a space are illegal.
+ period ({\bf .}). All other characters including a space are invalid.
This restriction is to ensure good readability of Volume names to reduce
operator errors.
Please note, when labeling a blank tape, Bacula will get {\bf read I/O
- error} when it attempts to ensure that the tape is already labeled. If
+ error} 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:
\begin{enumerate}
\item The Volume name you specify is already in the Volume database.
-\item The Storage daemon has a tape already mounted on the device, in which
- case you must {\bf unmount} the device, insert a blank tape, then do the
- {\bf label} command.
-\item The tape in the device is already a Bacula labeled tape. (Bacula will
- never relabel a Bacula labeled tape unless it is recycled and you use the
+
+\item The Storage daemon has a tape or other Volume already mounted on the
+ device, in which case you must {\bf unmount} the device, insert a blank
+ tape, then do the {\bf label} command.
+
+\item 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
{\bf relabel} command).
-\item There is no tape in the drive.
+
+\item There is no Volume in the drive.
\end{enumerate}
There are two ways to relabel a volume that already has a Bacula label. The
\end{verbatim}
\normalsize
+For a disk volume, you would manually delete the Volume.
+
Then you use the {\bf label} command to add a new label. However, this could
leave traces of the old volume in the catalog.
-The preferable method to relabel a tape is to first {\bf purge} the volume,
+The preferable method to relabel a Volume is to first {\bf purge} the volume,
either automatically, or explicitly with the {\bf purge} command, then use
the {\bf relabel} command described below.
-If your autochanger has barcode labels, you can label all the Volumes in your
-autochanger one after another by using the {\bf label barcodes} 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:
+If your autochanger has barcode labels, you can label all the Volumes in
+your autochanger one after another by using the {\bf label barcodes}
+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:
\footnotesize
\begin{verbatim}
Pool {
Name ...
Cleaning Prefix = "CLN"
- }
+ }
\end{verbatim}
\normalsize
-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:
+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:
\footnotesize
\begin{verbatim}
\begin{verbatim}
list jobs
- list jobid=\lt{}id\gt{}
+ list jobid=<id> (list jobid id)
+
+ list ujobid<unique job name> (list job with unique name)
- list job=\lt{}job-name\gt{}
+ list job=<job-name> (list all jobs with "job-name")
+
+ list jobname=<job-name> (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 jobid=<id>
- list jobmedia job=\lt{}job-name\gt{}
+ list jobmedia job=<job-name>
- list files jobid=\lt{}id\gt{}
+ list files jobid=<id>
- list files job=\lt{}job-name\gt{}
+ list files job=<job-name>
list pools
list volumes
- list volumes jobid=\lt{}id\gt{}
+ list volumes jobid=<id>
- list volumes pool=\lt{}pool-name\gt{}
+ list volumes pool=<pool-name>
- list volumes job=\lt{}job-name\gt{}
+ list volumes job=<job-name>
- list volume=\lt{}volume-name\gt{}
+ list volume=<volume-name>
- list nextvolume job=\lt{}job-name\gt{}
+ list nextvolume job=<job-name>
- list nextvol job=\lt{}job-name\gt{}
-
- list nextvol job=\lt{}job-name\gt{} days=nnn
-
+ list nextvol job=<job-name>
+ list nextvol job=<job-name> days=nnn
\end{verbatim}
\normalsize
Recycle: 1
PoolType: Backup
LabelFormat: *
+
PoolId: 2
Name: Recycle
NumVols: 0
\index[console]{mount}
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 used only after
- there was no Volume in a drive and Bacula requests you to mount a new
+ 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 {\bf
unmount} 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. The various forms of the mount command are:
+ operate the autoloader unless you specify a {\bf slot} and possibly a
+ {\bf drive}. The various forms of the mount command are:
-mount storage=\lt{}storage-name\gt{}
+mount storage=\lt{}storage-name\gt{} [ slot=\lt{}num\gt{} ] [
+ drive=\lt{}num\gt{} ]
mount [ jobid=\lt{}id\gt{} | job=\lt{}job-name\gt{} ]
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}{_ChapterStart60} chapter of this manual.
+ Scripting}{PythonChapter} chapter of this manual.
\label{ManualPruning}
\item [prune]
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
- 10 prior set of configurations before it will refuse a reload
+ 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.
configuration while Bacula is running, it is advisable to restart the
Director at the next convenient opportunity.
-
+\label{restore_command}
\item [restore]
\index[console]{restore}
The restore command allows you to select one or more Jobs (JobIds) to be
to be restored. This mode is somewhat similar to the standard Unix {\bf
restore} program's interactive file selection mode.
-restore storage=\lt{}storage-name\gt{} client=\lt{}client-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{}
select current all done
Where {\bf current}, if specified, tells the restore command to
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}{_ChapterStart13} of this
+ command, please see the \ilink{Restore Chapter}{RestoreChapter} of this
manual.
+ 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.
+
\item [run]
\index[console]{run}
This command allows you to schedule jobs to be run immediately. The full form
desired start time in YYYY-MM-DD HH:MM:SS format.
\item [setdebug]
+ \index[console]{setdebug}
\index[dir]{setdebug}
+ \index[dir]{debugging}
+ \index[dir]{debugging Win32}
+ \index[dir]{Windows!debugging}
This command is used to set the debug level in each daemon. The form of this
command is:
setdebug level=nn [trace=0/1 client=\lt{}client-name\gt{} | dir | director |
storage=\lt{}storage-name\gt{} | all]
- If trace=1 is set, then the tracing will be enabled, and the daemon
- where the setdebug applies will be placed in trace mode, and all debug
- output will go to the file {\bf bacula.trace} in the current directory
- of the daemon. Normally, tracing is used 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.
+ 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 {\bf bacula.trace} 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.
\item [show]
\index[console]{show}
+ \index[dir]{show}
The show command will list the Director's resource records as defined in
the Director's configuration file (normally {\bf bacula-dir.conf}).
- This command is used mainly for debugging purposes by developers. The
- following keywords are accepted on the show command line: directors,
- clients, counters, jobs, storages, catalogs, schedules, filesets,
- groups, pools, messages, all, help. Please don't confuse this command
+ 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 {\bf list}, which displays the contents of the catalog.
\item [sqlquery]
- \index[dir]{sqlquery}
+ \index[console]{sqlquery}
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
\item [status]
\index[dir]{status}
This command will display the status of the next jobs that are scheduled
- during the next twenty-four hours as well as the status of currently
+ 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 |
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
- hours, and a listing of the last 10 terminated jobs with their statuses.
+ 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, which
- means that it may prune or recycle a Volume; 2. The Volume listed is
- only a best guess. The Volume actually used may be different because of
+ 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.
JobId 2508 (MatouVerify) is waiting because only one job can run at a
time, hence it is simply "waiting execution"
- If you do a {\bf status dir}, it will by default list all jobs
- that are scheduled in the next two days. If you wish to see
- the jobs that are scheduled in the next 3 days (e.g. on Friday
- you want to see wat tapes are scheduled to be used on Monday), you
- can add the {\bf days=3} option.
+ If you do a {\bf status dir}, 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 {\bf
+ days=3} option. Note, a {\bf days=0} 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.
+
+ If your job seems to be blocked, you can get a general idea of the
+ problem by doing a {\bf status dir}, but you can most often get a
+ much more specific indication of the problem by doing a
+ {\bf status storage=xxx}. For example, on an idle test system, when
+ I do {\bf status storage=File}, I get:
+\footnotesize
+\begin{verbatim}
+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:
+utochanger "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 "Dummy" is not open or does not exist.
+No DEVICE structure.
+
+Device "DVD-Writer" (/dev/hdc) is not open.
+Device "File" (/tmp) is not open.
+====
+
+In Use Volume status:
+====
+\end{verbatim}
+\normalsize
+
+Now, what this tells me is that no jobs are running and that none of
+the devices are in use. Now, if I {\bf unmount} 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:
+
+\footnotesize
+\begin{verbatim}
+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 "Dummy" is not open or does not exist.
+No DEVICE structure.
+
+Device "DVD-Writer" (/dev/hdc) is not open.
+Device "File" (/tmp) is not open.
+ Device is BLOCKED waiting for media.
+====
+...
+\end{verbatim}
+\normalsize
+
+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.
\item [unmount]
\index[console]{unmount}
specified device. The forms of the command are the same as the mount command:
\footnotesize
\begin{verbatim}
-unmount storage=\lt{}storage-name\gt{}
+unmount storage=<storage-name> [ drive=<num> ]
-unmount [ jobid=\lt{}id\gt{} | job=\lt{}job-name\gt{} ]
+unmount [ jobid=<id> | job=<job-name> ]
\end{verbatim}
\normalsize
+ 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.
+
+ 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.
+
\label{UpdateCommand}
\item [update]
\index[console]{update}
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
\end{verbatim}
\normalsize
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 will have their InChanger flag turned off. This permits
+ 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.
For Pool {\bf update pool}, Bacula will move the Volume record from its
existing pool to the pool specified.
- For {\bf Volume from Pool} and {\bf All Volumes from Pool}, the
- following values are updated from the Pool record: Recycle,
- VolRetention, VolUseDuration, MaxVolJobs, MaxVolFiles, and MaxVolBytes.
+ For {\bf Volume from Pool}, {\bf All Volumes from Pool} and {\bf All Volumes
+ from all Pools}, 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.)
The full form of the update command with all command line arguments is:
\begin{verbatim}
update volume=xxx pool=yyy slots volstatus=xxx VolRetention=ddd
VolUse=ddd MaxVolJobs=nnn MaxVolBytes=nnn Recycle=yes|no
- slot=nnn
+ slot=nnn enabled=n recyclepool=zzz
\end{verbatim}
\normalsize
\item [use]
- \index[console]{use }
+ \index[console]{use}
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
\item [var]
\label{var}
- \index[console]{var name }
+ \index[console]{var name}
This command takes a string or quoted string and does variable expansion on
it the same way variable expansion is done on the {\bf LabelFormat} string.
Thus, for the most part, you can test your LabelFormat strings. The
good idea of what is going to happen in the real case.
\item [version]
- \index[console]{version }
+ \index[console]{version}
The command prints the Director's version.
\item [quit]
- \index[console]{quit }
+ \index[console]{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).
+ {\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[console]{query }
+ \index[console]{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
\normalsize
\item [exit]
- \index[console]{exit }
+ \index[console]{exit}
This command terminates the console program.
\item [wait]
- \index[console]{wait }
+ \index[console]{wait}
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.
+ 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:
+\footnotesize
+\begin{verbatim}
+ wait [jobid=nn] [jobuid=unique id] [job=job name]
+\end{verbatim}
+\normalsize
+ If specified with a specific JobId, ... the wait command will wait
+ for that particular job to terminate before continuing.
+
\end{description}
\label{dotcommands}
-
-\subsection*{Special dot Commands}
-\index[general]{Commands!Special dot }
-\index[general]{Special dot Commands }
-\addcontentsline{toc}{subsection}{Special dot Commands}
+\section{Special dot Commands}
+\index[general]{Commands!Special dot}
+\index[general]{Special dot Commands}
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
\footnotesize
\begin{verbatim}
.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
-.filesets list all fileset names
-.clients list all client names
-.pools list all pool names
-.types list job types
-.msgs return any queued messages
.messages get quick messages
-.help help command output
+.msgs return any queued messages
+.pools list all pool names
.quit quit
.status get status output
-.exit quit
+.storage return storage resource names
+.types list job types
\end{verbatim}
\normalsize
\label{atcommands}
-\subsection*{Special At (@) Commands}
-\index[general]{Commands!Special At @ }
-\index[general]{Special At (@) Commands }
-\addcontentsline{toc}{subsection}{Special At (@) Commands}
+\section{Special At (@) Commands}
+\index[general]{Commands!Special At @}
+\index[general]{Special At (@) Commands}
Normally, all commands entered to the Console program are immediately
forwarded to the Director, which may be on another machine, to be executed.
\begin{description}
\item [@input \lt{}filename\gt{}]
- \index[console]{@input \lt{}filename\gt{} }
+ \index[console]{@input \lt{}filename\gt{}}
Read and execute the commands contained in the file specified.
\item [@output \lt{}filename\gt{} w/a]
- \index[console]{@output \lt{}filename\gt{} w/a }
+ \index[console]{@output \lt{}filename\gt{} w/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 {\bf @output} without a filename specification.
\normalsize
\item [@tee \lt{}filename\gt{} w/a]
- \index[console]{@tee \lt{}filename\gt{} w/a }
+ \index[console]{@tee \lt{}filename\gt{} w/a}
Send all subsequent output to both the specified file and the terminal. It is
turned off by specifying {\bf @tee} or {\bf @output} without a filename.
\item [@sleep \lt{}seconds\gt{}]
- \index[console]{@sleep \lt{}seconds\gt{} }
+ \index[console]{@sleep \lt{}seconds\gt{}}
Sleep the specified number of seconds.
\item [@time]
- \index[console]{@time }
+ \index[console]{@time}
Print the current time and date.
\item [@version]
- \index[console]{@version }
+ \index[console]{@version}
Print the console's version.
\item [@quit]
- \index[console]{@quit }
+ \index[console]{@quit}
quit
\item [@exit]
- \index[console]{@exit }
+ \index[console]{@exit}
quit
\item [@\# anything]
- \index[console]{anything }
+ \index[console]{anything}
Comment
\end{description}
\label{scripting}
-\subsection*{Running the Console Program from a Shell Script}
-\index[general]{Script!Running the Console Program from a Shell }
-\index[general]{Running the Console Program from a Shell Script }
-\addcontentsline{toc}{subsection}{Running the Console Program from a Shell
-Script}
+\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}
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
\end{verbatim}
\normalsize
-\subsection*{Adding Volumes to a Pool}
-\index[general]{Adding Volumes to a Pool }
-\index[general]{Pool!Adding Volumes to a }
-\addcontentsline{toc}{subsection}{Adding Volumes to a Pool}
+\section{Adding Volumes to a Pool}
+\index[general]{Adding Volumes to a Pool}
+\index[general]{Pool!Adding Volumes to a}
If you have used the {\bf label} command to label a Volume, it will be
automatically added to the Pool, and you will not need to add any media to the