directory, in addition, the data backed up will be the source directory where
you built Bacula. As a consequence, you can run all the Bacula daemons for
these tests as non-root. Please note, in production, your File daemon(s) must
-run as root. See the Security chapter for more information on this subject.
+run as root. See the Security chapter for more information on this subject.
% TODO: use crossreferences above
% TODO: add a section here
-The general flow of running Bacula is:
+The general flow of running Bacula is:
\begin{enumerate}
-\item cd \lt{}install-directory\gt{}
-\item Start the Database (if using MySQL or PostgreSQL)
-\item Start the Daemons with {\bf ./bacula start}
-\item Start the Console program to interact with the Director
-\item Run a job
+\item cd \lt{}install-directory\gt{}
+\item Start the Database (if using MySQL or PostgreSQL)
+\item Start the Daemons with {\bf ./bacula start}
+\item Start the Console program to interact with the Director
+\item Run a job
\item When the Volume fills, unmount the Volume, if it is a tape, label a new
one, and continue running. In this chapter, we will write only to disk files
- so you won't need to worry about tapes for the moment.
+ so you won't need to worry about tapes for the moment.
\item Test recovering some files from the Volume just written to ensure the
backup is good and that you know how to recover. Better test before disaster
- strikes
-\item Add a second client.
+ strikes
+\item Add a second client.
\end{enumerate}
-Each of these steps is described in more detail below.
+Each of these steps is described in more detail below.
\section{Before Running Bacula}
\index[general]{Bacula!Before Running }
% TODO: or quickstart. Consolidate!
Before running Bacula for the first time in production, we recommend that you
-run the {\bf test} command in the {\bf btape} program as described in the
-\ilink{Utility Program Chapter}{btape} of this manual. This will
+run the {\bf test} command in the {\bf btape} program as described in the
+\bsysxrlink{Utility Program}{btape}{utility}{chapter} of the \utilityman{}. This will
help ensure that Bacula functions correctly with your tape drive. If you have
a modern HP, Sony, or Quantum DDS or DLT tape drive running on Linux or
Solaris, you can probably skip this test as Bacula is well tested with these
run the test before continuing. {\bf btape} also has a {\bf fill} command that
attempts to duplicate what Bacula does when filling a tape and writing on the
next tape. You should consider trying this command as well, but be forewarned,
-it can take hours (about four hours on my drive) to fill a large capacity tape.
+it can take hours (about four hours on my drive) to fill a large capacity tape.
\section{Starting the Database}
\label{StartDB}
(Kern) use to start and stop my local MySQL. Note, if you are using SQLite,
you will not want to use {\bf startmysql} or {\bf stopmysql}. If you are
running this in production, you will probably want to find some way to
-automatically start MySQL or PostgreSQL after each system reboot.
+automatically start MySQL or PostgreSQL after each system reboot.
-If you are using SQLite (i.e. you specified the {\bf \verb:--:with-sqlite=xxx} option
+If you are using SQLite (i.e. you specified the {\bf \lstinline:--:with-sqlite=xxx} option
on the {\bf ./configure} command, you need do nothing. SQLite is automatically
-started by {\bf Bacula}.
+started by {\bf Bacula}.
\section{Starting the Daemons}
\label{StartDaemon}
\index[general]{Daemons!Starting the }
Assuming you have built from source or have installed the rpms,
-to start the three daemons, from your installation directory, simply enter:
+to start the three daemons, from your installation directory, simply enter:
-./bacula start
+./bacula start
The {\bf bacula} script starts the Storage daemon, the File daemon, and the
Director daemon, which all normally run as daemons in the background. If you
automatically started on reboot, or you can control them individually with the
files {\bf bacula-dir}, {\bf bacula-fd}, and {\bf bacula-sd}, which are
usually located in {\bf /etc/init.d}, though the actual location is system
-dependent.
+dependent.
Some distributions may do this differently.
Note, on Windows, currently only the File daemon is ported, and it must be
-started differently. Please see the
+started differently. Please see the
\ilink{Windows Version of Bacula}{Win32Chapter} Chapter of this
-manual.
+manual.
The rpm packages configure the daemons to run as user=root and group=bacula.
The rpm installation also creates the group bacula if it does not exist on the
system. Any users that you add to the group bacula will have access to files
created by the daemons. To disable or alter this behavior edit the daemon
-startup scripts:
+startup scripts:
-\begin{itemize}
-\item /etc/bacula/bacula
-\item /etc/init.d/bacula-dir
-\item /etc/init.d/bacula-sd
-\item /etc/init.d/bacula-fd
- \end{itemize}
+\begin{bsysitemize}
+\item /etc/bacula/bacula
+\item /etc/init.d/bacula-dir
+\item /etc/init.d/bacula-sd
+\item /etc/init.d/bacula-fd
+ \end{bsysitemize}
-and then restart as noted above.
+and then restart as noted above.
-The
+The
\ilink{installation chapter}{InstallChapter} of this manual
explains how you can install scripts that will automatically restart the
-daemons when the system starts.
+daemons when the system starts.
\section{Using the Director to Query and Start Jobs}
\index[general]{Jobs!Querying or Starting Jobs}
% TODO: section name is too long; maybe use "Using the Console Program" ??
To communicate with the director and to query the state of Bacula or run jobs,
-from the top level directory, simply enter:
+from the top level directory, simply enter:
-./bconsole
+./bconsole
Alternatively to running the command line console, if you have
-Qt4 installed and used the {\bf \verb:--:enable-bat} on the configure command,
+Qt4 installed and used the {\bf \lstinline:--:enable-bat} on the configure command,
you may use the Bacula Administration Tool ({\bf bat}):
./bat
Which has a graphical interface, and many more features than bconsole.
-Two other possibilities are to run the GNOME console
+Two other possibilities are to run the GNOME console
{\bf bgnome-console} or the wxWidgets program {\bf bwx-console}.
For simplicity, here we will describe only the {\bf ./bconsole} program. Most
Director daemon. Since Bacula is a network program, you can run the Console
program anywhere on your network. Most frequently, however, one runs it on the
same machine as the Director. Normally, the Console program will print
-something similar to the following:
+something similar to the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
[kern@polymatou bin]$ ./bconsole
Connecting to Director lpmatou:9101
1000 OK: HeadMan Version: 2.1.8 (14 May 2007)
*
-\end{verbatim}
+\end{lstlisting}
\normalsize
-the asterisk is the console command prompt.
+the asterisk is the console command prompt.
-Type {\bf help} to see a list of available commands:
+Type {\bf help} to see a list of available commands:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
*help
Command Description
======= ===========
version print Director version
wait wait until no jobs are running [<jobname=name> | <jobid=nnn> | <ujobid=complete_name>]
*
-\end{verbatim}
+\end{lstlisting}
\normalsize
-Details of the console program's commands are explained in the
-\ilink{Console Chapter}{_ConsoleChapter} of this manual.
+Details of the console program's commands are explained in the
+\bsysxrlink{Console}{_ConsoleChapter}{console}{chapter} of the \consoleman{}.
\section{Running a Job}
\label{Running}
\index[general]{Job!Running a }
\index[general]{Running a Job }
-At this point, we assume you have done the following:
+At this point, we assume you have done the following:
-\begin{itemize}
-\item Configured Bacula with {\bf ./configure \verb:--:your-options}
-\item Built Bacula using {\bf make}
-\item Installed Bacula using {\bf make install}
+\begin{bsysitemize}
+\item Configured Bacula with {\bf ./configure \lstinline:--:your-options}
+\item Built Bacula using {\bf make}
+\item Installed Bacula using {\bf make install}
\item Have created your database with, for example, {\bf
- ./create\_sqlite\_database}
+ ./create\_sqlite\_database}
\item Have created the Bacula database tables with, {\bf
- ./make\_bacula\_tables}
+ ./make\_bacula\_tables}
\item Have possibly edited your {\bf bacula-dir.conf} file to personalize it
a bit. BE CAREFUL! if you change the Director's name or password, you will
need to make similar modifications in the other .conf files. For the moment
- it is probably better to make no changes.
-\item You have started Bacula with {\bf ./bacula start}
-\item You have invoked the Console program with {\bf ./bconsole}
-\end{itemize}
+ it is probably better to make no changes.
+\item You have started Bacula with {\bf ./bacula start}
+\item You have invoked the Console program with {\bf ./bconsole}
+\end{bsysitemize}
Furthermore, we assume for the moment you are using the default configuration
-files.
+files.
-At this point, enter the following command:
+At this point, enter the following command:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
show filesets
-\end{verbatim}
+\end{lstlisting}
\normalsize
-and you should get something similar to:
+and you should get something similar to:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
FileSet: name=Full Set
O M
N
N
I /home/kern/bacula/regress/working/bacula.sql
N
-\end{verbatim}
+\end{lstlisting}
\normalsize
This is a pre-defined {\bf FileSet} that will backup the Bacula source
to us for the moment. The {\bf I} entries are the files or directories that
will be included in the backup and the {\bf E} are those that will be
excluded, and the {\bf O} entries are the options specified for
-the FileSet. You can change what is backed up by editing {\bf bacula-dir.conf}
+the FileSet. You can change what is backed up by editing {\bf bacula-dir.conf}
and changing the {\bf File =} line in the {\bf FileSet} resource.
Now is the time to run your first backup job. We are going to backup your
Bacula source directory to a File Volume in your {\bf /tmp} directory just to
-show you how easy it is. Now enter:
+show you how easy it is. Now enter:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
status dir
-\end{verbatim}
+\end{lstlisting}
\normalsize
-and you should get the following output:
+and you should get the following output:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
rufus-dir Version: 1.30 (28 April 2003)
Daemon started 28-Apr-2003 14:03, 0 Jobs run.
Console connected at 28-Apr-2003 14:03
Incremental Backup 29-Apr-2003 01:05 Client1
Full Backup 29-Apr-2003 01:10 BackupCatalog
====
-\end{verbatim}
+\end{lstlisting}
\normalsize
where the times and the Director's name will be different according to your
run. Note, you should probably change the name {\bf Client1} to be the name of
your machine, if not, when you add additional clients, it will be very
confusing. For my real machine, I use {\bf Rufus} rather than {\bf Client1} as
-in this example.
+in this example.
-Now enter:
+Now enter:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
status client
-\end{verbatim}
+\end{lstlisting}
\normalsize
-and you should get something like:
+and you should get something like:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
The defined Client resources are:
1: rufus-fd
Item 1 selected automatically.
Director connected at: 28-Apr-2003 14:14
No jobs running.
====
-\end{verbatim}
+\end{lstlisting}
\normalsize
In this case, the client is named {\bf rufus-fd} your name will be different,
but the line beginning with {\bf rufus-fd Version ...} is printed by your File
-daemon, so we are now sure it is up and running.
+daemon, so we are now sure it is up and running.
-Finally do the same for your Storage daemon with:
+Finally do the same for your Storage daemon with:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
status storage
-\end{verbatim}
+\end{lstlisting}
\normalsize
-and you should get:
+and you should get:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
The defined Storage resources are:
1: File
Item 1 selected automatically.
Device /tmp is not open.
No jobs running.
====
-\end{verbatim}
+\end{lstlisting}
\normalsize
You will notice that the default Storage daemon device is named {\bf File} and
-that it will use device {\bf /tmp}, which is not currently open.
+that it will use device {\bf /tmp}, which is not currently open.
-Now, let's actually run a job with:
+Now, let's actually run a job with:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
run
-\end{verbatim}
+\end{lstlisting}
\normalsize
-you should get the following output:
+you should get the following output:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Using default Catalog name=MyCatalog DB=bacula
A job name must be specified.
The defined Job resources are:
2: BackupCatalog
3: RestoreFiles
Select Job resource (1-3):
-\end{verbatim}
+\end{lstlisting}
\normalsize
Here, Bacula has listed the three different Jobs that you can run, and you
-should choose number {\bf 1} and type enter, at which point you will get:
+should choose number {\bf 1} and type enter, at which point you will get:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Run Backup job
JobName: Client1
FileSet: Full Set
Pool: Default
When: 2003-04-28 14:18:57
OK to run? (yes/mod/no):
-\end{verbatim}
+\end{lstlisting}
\normalsize
At this point, take some time to look carefully at what is printed and
with FileSet {\bf Full Set} (we listed above) as an Incremental job on your
Client (your client name will be different), and to use Storage {\bf File} and
Pool {\bf Default}, and finally, it wants to run it now (the current time
-should be displayed by your console).
+should be displayed by your console).
Here we have the choice to run ({\bf yes}), to modify one or more of the above
parameters ({\bf mod}), or to not run the job ({\bf no}). Please enter {\bf
yes}, at which point you should immediately get the command prompt (an
asterisk). If you wait a few seconds, then enter the command {\bf messages}
-you will get back something like:
+you will get back something like:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
28-Apr-2003 14:22 rufus-dir: Last FULL backup time not found. Doing
FULL backup.
28-Apr-2003 14:22 rufus-dir: Start Backup JobId 1,
Storage: FileStorage
Media type: File
Pool: Default
-\end{verbatim}
+\end{lstlisting}
\normalsize
The first message, indicates that no previous Full backup was done, so Bacula
message indicates that the job started with JobId 1., and the third message
tells us that Bacula cannot find any Volumes in the Pool for writing the
output. This is normal because we have not yet created (labeled) any Volumes.
-Bacula indicates to you all the details of the volume it needs.
+Bacula indicates to you all the details of the volume it needs.
At this point, the job is BLOCKED waiting for a Volume. You can check this if
you want by doing a {\bf status dir}. In order to continue, we must create a
-Volume that Bacula can write on. We do so with:
+Volume that Bacula can write on. We do so with:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
label
-\end{verbatim}
+\end{lstlisting}
\normalsize
-and Bacula will print:
+and Bacula will print:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
The defined Storage resources are:
1: File
Item 1 selected automatically.
Enter new Volume name:
-\end{verbatim}
+\end{lstlisting}
\normalsize
at which point, you should enter some name beginning with a letter and
containing only letters and numbers (period, hyphen, and underscore) are also
-permitted. For example, enter {\bf TestVolume001}, and you should get back:
+permitted. For example, enter {\bf TestVolume001}, and you should get back:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Defined Pools:
1: Default
Item 1 selected automatically.
Catalog record for Volume "TestVolume002", Slot 0 successfully created.
Requesting mount FileStorage ...
3001 OK mount. Device=/tmp
-\end{verbatim}
+\end{lstlisting}
\normalsize
-Finally, enter {\bf messages} and you should get something like:
+Finally, enter {\bf messages} and you should get something like:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
28-Apr-2003 14:30 rufus-sd: Wrote label to prelabeled Volume
"TestVolume001" on device /tmp
28-Apr-2003 14:30 rufus-dir: Bacula 1.30 (28Apr03): 28-Apr-2003 14:30
28-Apr-2003 14:30 rufus-dir: Begin pruning Files.
28-Apr-2003 14:30 rufus-dir: No Files found to prune.
28-Apr-2003 14:30 rufus-dir: End auto prune.
-\end{verbatim}
+\end{lstlisting}
\normalsize
If you don't see the output immediately, you can keep entering {\bf messages}
until the job terminates, or you can enter, {\bf autodisplay on} and your
-messages will automatically be displayed as soon as they are ready.
+messages will automatically be displayed as soon as they are ready.
If you do an {\bf ls -l} of your {\bf /tmp} directory, you will see that you
-have the following item:
+have the following item:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
-rw-r----- 1 kern kern 39072153 Apr 28 14:30 TestVolume001
-\end{verbatim}
+\end{lstlisting}
\normalsize
This is the file Volume that you just wrote and it contains all the data of
the job just run. If you run additional jobs, they will be appended to this
-Volume unless you specify otherwise.
+Volume unless you specify otherwise.
You might ask yourself if you have to label all the Volumes that Bacula is
going to use. The answer for disk Volumes, like the one we used, is no. It is
possible to have Bacula automatically label volumes. For tape Volumes, you
-will most likely have to label each of the Volumes you want to use.
+will most likely have to label each of the Volumes you want to use.
If you would like to stop here, you can simply enter {\bf quit} in the Console
program, and you can stop Bacula with {\bf ./bacula stop}. To clean up, simply
delete the file {\bf /tmp/TestVolume001}, and you should also re-initialize
-your database using:
+your database using:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
./drop_bacula_tables
./make_bacula_tables
-\end{verbatim}
+\end{lstlisting}
\normalsize
Please note that this will erase all information about the previous jobs that
have run, and that you might want to do it now while testing but that normally
-you will not want to re-initialize your database.
+you will not want to re-initialize your database.
If you would like to try restoring the files that you just backed up, read the
-following section.
+following section.
\label{restoring}
\section{Restoring Your Files}
If you have run the default configuration and the save of the Bacula source
code as demonstrated above, you can restore the backed up files in the Console
-program by entering:
+program by entering:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
restore all
-\end{verbatim}
+\end{lstlisting}
\normalsize
-where you will get:
+where you will get:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
First you select one or more JobIds that contain files
to be restored. You will be presented several methods
of specifying the JobIds. Then you will be allowed to
10: Find the JobIds for a backup for a client before a specified time
11: Enter a list of directories to restore for found JobIds
12: Cancel
-Select item: (1-12):
-\end{verbatim}
+Select item: (1-12):
+\end{lstlisting}
\normalsize
As you can see, there are a number of options, but for the current
demonstration, please enter {\bf 5} to do a restore of the last backup you
-did, and you will get the following output:
+did, and you will get the following output:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Defined Clients:
1: rufus-fd
Item 1 selected automatically.
Enter "done" to leave this mode.
cwd is: /
$
-\end{verbatim}
+\end{lstlisting}
\normalsize
where I have truncated the listing on the right side to make it more readable.
and view what files will be restored. For example, if I enter {\bf cd
/home/kern/bacula/bacula-1.30} and then enter {\bf dir} I will get a listing
of all the files in the Bacula source directory. On your system, the path will
-be somewhat different. For more information on this, please refer to the
+be somewhat different. For more information on this, please refer to the
\ilink{Restore Command Chapter}{RestoreChapter} of this manual for
-more details.
+more details.
-To exit this mode, simply enter:
+To exit this mode, simply enter:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
done
-\end{verbatim}
+\end{lstlisting}
\normalsize
-and you will get the following output:
+and you will get the following output:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Bootstrap records written to
/home/kern/bacula/testbin/working/restore.bsr
The restore job will require the following Volumes:
-
+
TestVolume001
1444 files selected to restore.
Run Restore job
JobId: *None*
When: 2005-04-28 14:53:54
OK to run? (yes/mod/no):
-\end{verbatim}
+\end{lstlisting}
\normalsize
If you answer {\bf yes} your files will be restored to {\bf
to nothing (or to /). We recommend you go ahead and answer {\bf yes} and after
a brief moment, enter {\bf messages}, at which point you should get a listing
of all the files that were restored as well as a summary of the job that looks
-similar to this:
+similar to this:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
28-Apr-2005 14:56 rufus-dir: Bacula 2.1.8 (08May07): 08-May-2007 14:56:06
Build OS: i686-pc-linux-gnu suse 10.2
JobId: 2
08-May-2007 14:56 rufus-dir: Begin pruning Files.
08-May-2007 14:56 rufus-dir: No Files found to prune.
08-May-2007 14:56 rufus-dir: End auto prune.
-\end{verbatim}
+\end{lstlisting}
\normalsize
After exiting the Console program, you can examine the files in {\bf
/tmp/bacula-restores}, which will contain a small directory tree with all the
-files. Be sure to clean up at the end with:
+files. Be sure to clean up at the end with:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
rm -rf /tmp/bacula-restore
-\end{verbatim}
+\end{lstlisting}
\normalsize
\section{Quitting the Console Program}
\index[general]{Program!Quitting the Console }
\index[general]{Quitting the Console Program }
-Simply enter the command {\bf quit}.
+Simply enter the command {\bf quit}.
\label{SecondClient}
\section{Adding a Second Client}
modification to it to create the conf file for your second client. Change the
File daemon name from whatever was configured, {\bf rufus-fd} in the example
above, but your system will have a different name. The best is to change it to
-the name of your second machine. For example:
+the name of your second machine. For example:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
...
#
# "Global" File daemon configuration specifications
Pid Directory = /var/run
}
...
-\end{verbatim}
+\end{lstlisting}
\normalsize
-would become:
+would become:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
...
#
# "Global" File daemon configuration specifications
Pid Directory = /var/run
}
...
-\end{verbatim}
+\end{lstlisting}
\normalsize
where I show just a portion of the file and have changed {\bf rufus-fd} to
{\bf matou-fd}. The names you use are your choice. For the moment, I recommend
-you change nothing else. Later, you will want to change the password.
+you change nothing else. Later, you will want to change the password.
Now you should install that change on your second machine. Then you need to
make some additions to your Director's configuration file to define the new
File daemon or Client. Starting from our original example which should be
installed on your system, you should add the following lines (essentially
copies of the existing data but with the names changed) to your Director's
-configuration file {\bf bacula-dir.conf}.
+configuration file {\bf bacula-dir.conf}.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
#
# Define the main nightly save backup job
# By default, this job will back up to disk in /tmp
Job Retention = 180d # six months
AutoPrune = yes # Prune expired Jobs/Files
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
Then make sure that the Address parameter in the Storage resource is set to
address specified is sent to the File daemon (client) and it must be a fully
qualified domain name. If you pass something like "localhost" it will not
resolve correctly and will result in a time out when the File daemon fails to
-connect to the Storage daemon.
+connect to the Storage daemon.
That is all that is necessary. I copied the existing resource to create a
second Job (Matou) to backup the second client (matou-fd). It has the name
{\bf Matou}, the Client is named {\bf matou-fd}, and the bootstrap file name
is changed, but everything else is the same. This means that Matou will be
backed up on the same schedule using the same set of tapes. You may want to
-change that later, but for now, let's keep it simple.
+change that later, but for now, let's keep it simple.
The second change was to add a new Client resource that defines {\bf matou-fd}
and has the correct address {\bf matou}, but in real life, you may need a
fully qualified domain name or an IP address. I also kept the password the
-same (shown as xxxxx for the example).
+same (shown as xxxxx for the example).
At this point, if you stop Bacula and restart it, and start the Client on the
other machine, everything will be ready, and the prompts that you saw above
-will now include the second machine.
+will now include the second machine.
To make this a real production installation, you will possibly want to use
different Pool, or a different schedule. It is up to you to customize. In any
case, you should change the password in both the Director's file and the
-Client's file for additional security.
+Client's file for additional security.
For some important tips on changing names and passwords, and a diagram of what
-names and passwords must match, please see
-\ilink{Authorization Errors}{AuthorizationErrors} in the FAQ chapter
-of this manual.
+names and passwords must match, please see
+\bsysxrlink{Authorization Errors}{AuthorizationErrors}{problems}{chapter} in the \problemsman{}.
\section{When The Tape Fills}
\label{FullTape}
If you have scheduled your job, typically nightly, there will come a time when
the tape fills up and {\bf Bacula} cannot continue. In this case, Bacula will
-send you a message similar to the following:
+send you a message similar to the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
rufus-sd: block.c:337 === Write error errno=28: ERR=No space left
on device
-\end{verbatim}
+\end{lstlisting}
\normalsize
This indicates that Bacula got a write error because the tape is full. Bacula
volume. In the best of all cases, you will have properly set your Retention
Periods and you will have all your tapes marked to be Recycled, and {\bf
Bacula} will automatically recycle the tapes in your pool requesting and
-overwriting old Volumes. For more information on recycling, please see the
+overwriting old Volumes. For more information on recycling, please see the
\ilink{Recycling chapter}{RecyclingChapter} of this manual. If you
find that your Volumes were not properly recycled (usually because of a
-configuration error), please see the
+configuration error), please see the
\ilink{Manually Recycling Volumes}{manualrecycling} section of
-the Recycling chapter.
+the Recycling chapter.
If like me, you have a very large set of Volumes and you label them with the
date the Volume was first writing, or you have not set up your Retention
periods, Bacula will not find a tape in the pool, and it will send you a
-message similar to the following:
+message similar to the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
rufus-sd: Job kernsave.2002-09-19.10:50:48 waiting. Cannot find any
appendable volumes.
Please use the "label" command to create a new Volume for:
Storage: SDT-10000
Media type: DDS-4
Pool: Default
-\end{verbatim}
+\end{lstlisting}
\normalsize
Until you create a new Volume, this message will be repeated an hour later,
then two hours later, and so on doubling the interval each time up to a
-maximum interval of one day.
+maximum interval of one day.
-The obvious question at this point is: What do I do now?
+The obvious question at this point is: What do I do now?
The answer is simple: first, using the Console program, close the tape drive
using the {\bf unmount} command. If you only have a single drive, it will be
automatically selected, otherwise, make sure you release the one specified on
-the message (in this case {\bf STD-10000}).
+the message (in this case {\bf STD-10000}).
Next, you remove the tape from the drive and insert a new blank tape. Note, on
some older tape drives, you may need to write an end of file mark ({\bf mt \
-f \ /dev/nst0 \ weof}) to prevent the drive from running away when Bacula
-attempts to read the label.
+attempts to read the label.
Finally, you use the {\bf label} command in the Console to write a label to
the new Volume. The {\bf label} command will contact the Storage daemon to
write the software label, if it is successful, it will add the new Volume to
the Pool, then issue a {\bf mount} command to the Storage daemon. See the
-previous sections of this chapter for more details on labeling tapes.
+previous sections of this chapter for more details on labeling tapes.
The result is that Bacula will continue the previous Job writing the backup to
-the new Volume.
+the new Volume.
If you have a Pool of volumes and Bacula is cycling through them, instead of
the above message "Cannot find any appendable volumes.", Bacula may ask you
can simply mount another volume from the same Pool, providing it is
appendable, and Bacula will use it. You can use the {\bf list volumes} command
in the console program to determine which volumes are appendable and which are
-not.
+not.
If like me, you have your Volume retention periods set correctly, but you have
-no more free Volumes, you can relabel and reuse a Volume as follows:
+no more free Volumes, you can relabel and reuse a Volume as follows:
-\begin{itemize}
+\begin{bsysitemize}
\item Do a {\bf list volumes} in the Console and select the oldest Volume for
- relabeling.
+ relabeling.
\item If you have setup your Retention periods correctly, the Volume should
- have VolStatus {\bf Purged}.
+ have VolStatus {\bf Purged}.
\item If the VolStatus is not set to Purged, you will need to purge the
database of Jobs that are written on that Volume. Do so by using the command
{\bf purge jobs volume} in the Console. If you have multiple Pools, you will
be prompted for the Pool then enter the VolumeName (or MediaId) when
-requested.
-\item Then simply use the {\bf relabel} command to relabel the Volume.
- \end{itemize}
+requested.
+\item Then simply use the {\bf relabel} command to relabel the Volume.
+ \end{bsysitemize}
-To manually relabel the Volume use the following additional steps:
+To manually relabel the Volume use the following additional steps:
-\begin{itemize}
-\item To delete the Volume from the catalog use the {\bf delete volume}
- command in the Console and select the VolumeName (or MediaId) to be deleted.
+\begin{bsysitemize}
+\item To delete the Volume from the catalog use the {\bf delete volume}
+ command in the Console and select the VolumeName (or MediaId) to be deleted.
-\item Use the {\bf unmount} command in the Console to unmount the old tape.
+\item Use the {\bf unmount} command in the Console to unmount the old tape.
\item Physically relabel the old Volume that you deleted so that it can be
- reused.
-\item Insert the old Volume in the tape drive.
+ reused.
+\item Insert the old Volume in the tape drive.
\item From a command line do: {\bf mt \ -f \ /dev/st0 \ rewind} and {\bf mt \
-f \ /dev/st0 \ weof}, where you need to use the proper tape drive name for
- your system in place of {\bf /dev/st0}.
+ your system in place of {\bf /dev/st0}.
\item Use the {\bf label} command in the Console to write a new Bacula label
- on your tape.
-\item Use the {\bf mount} command in the Console if it is not automatically
- done, so that Bacula starts using your newly labeled tape.
- \end{itemize}
+ on your tape.
+\item Use the {\bf mount} command in the Console if it is not automatically
+ done, so that Bacula starts using your newly labeled tape.
+ \end{bsysitemize}
\section{Other Useful Console Commands}
\index[general]{Commands!Other Useful Console }
\item [status dir]
\index[console]{status dir }
- Print a status of all running jobs and jobs scheduled in the next 24 hours.
+ Print a status of all running jobs and jobs scheduled in the next 24 hours.
\item [status]
\index[console]{status }
The console program will prompt you to select a daemon type, then will
-request the daemon's status.
+request the daemon's status.
\item [status jobid=nn]
\index[console]{status jobid }
Print a status of JobId nn if it is running. The Storage daemon is contacted
-and requested to print a current status of the job as well.
+and requested to print a current status of the job as well.
\item [list pools]
\index[console]{list pools }
- List the pools defined in the Catalog (normally only Default is used).
+ List the pools defined in the Catalog (normally only Default is used).
\item [list media]
\index[console]{list media }
- Lists all the media defined in the Catalog.
+ Lists all the media defined in the Catalog.
\item [list jobs]
\index[console]{list jobs }
- Lists all jobs in the Catalog that have run.
+ Lists all jobs in the Catalog that have run.
\item [list jobid=nn]
\index[console]{list jobid }
- Lists JobId nn from the Catalog.
+ Lists JobId nn from the Catalog.
\item [list jobtotals]
\index[console]{list jobtotals }
- Lists totals for all jobs in the Catalog.
+ Lists totals for all jobs in the Catalog.
\item [list files jobid=nn]
\index[console]{list files jobid }
- List the files that were saved for JobId nn.
+ List the files that were saved for JobId nn.
\item [list jobmedia]
\index[console]{list jobmedia }
- List the media information for each Job run.
+ List the media information for each Job run.
\item [messages]
\index[console]{messages }
- Prints any messages that have been directed to the console.
+ Prints any messages that have been directed to the console.
\item [unmount storage=storage-name]
\index[console]{unmount storage }
Unmounts the drive associated with the storage device with the name {\bf
storage-name} if the drive is not currently being used. This command is used
-if you wish Bacula to free the drive so that you can use it to label a tape.
+if you wish Bacula to free the drive so that you can use it to label a tape.
\item [mount storage=storage-name]
Bacula reaches the end of a volume and requests you to mount a new volume,
you must issue this command after you have placed the new volume in the
drive. In effect, it is the signal needed by Bacula to know to start reading
-or writing the new volume.
+or writing the new volume.
\item [quit]
\index[sd]{quit }
- Exit or quit the console program.
+ Exit or quit the console program.
\end{description}
Most of the commands given above, with the exception of {\bf list}, will
-prompt you for the necessary arguments if you simply enter the command name.
+prompt you for the necessary arguments if you simply enter the command name.
\section{Debug Daemon Output}
\index[general]{Debug Daemon Output }
\index[general]{Output!Debug Daemon }
If you want debug output from the daemons as they are running, start the
-daemons from the install directory as follows:
+daemons from the install directory as follows:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
./bacula start -d100
-\end{verbatim}
+\end{lstlisting}
\normalsize
This can be particularly helpful if your daemons do not start correctly,
NULL device, but with the debug level greater than zero, the output
will be sent to the starting terminal.
-To stop the three daemons, enter the following from the install directory:
+To stop the three daemons, enter the following from the install directory:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
./bacula stop
-\end{verbatim}
+\end{lstlisting}
\normalsize
The execution of {\bf bacula stop} may complain about pids not found. This is
-OK, especially if one of the daemons has died, which is very rare.
+OK, especially if one of the daemons has died, which is very rare.
To do a full system save, each File daemon must be running as root so that it
will have permission to access all the files. None of the other daemons
tape drives. On many systems, only root can access the tape drives. Either run
the Storage daemon as root, or change the permissions on the tape devices to
permit non-root access. MySQL and PostgreSQL can be installed and run with any
-userid; root privilege is not necessary.
+userid; root privilege is not necessary.
\section{Patience When Starting Daemons or Mounting Blank Tapes}
used, it will be rewound, and on some devices this can take several minutes.
As a consequence, you may need to have a bit of patience when first contacting
the Storage daemon after starting the daemons. If you can see your tape drive,
-once the lights stop flashing, the drive will be ready to be used.
+once the lights stop flashing, the drive will be ready to be used.
The same considerations apply if you have just mounted a blank tape in a drive
such as an HP DLT. It can take a minute or two before the drive properly
the Console program during this recognition period, it is quite possible that
you will hang your SCSI driver (at least on my Red Hat Linux system). As a
consequence, you are again urged to have patience when inserting blank tapes.
-Let the device settle down before attempting to access it.
+Let the device settle down before attempting to access it.
\section{Difficulties Connecting from the FD to the SD}
\index[general]{Difficulties Connecting from the FD to the SD}
localhost}. An example that may work: {\bf megalon}. An example that is more
likely to work: {\bf magalon.mydomain.com}. On Win32 if you don't have a good
resolver (often true on older Win98 systems), you might try using an IP
-address in place of a name.
+address in place of a name.
If your address is correct, then make sure that no other program is using the
port 9103 on the Storage daemon's machine. The Bacula port numbers are
authorized by IANA, and should not be used by other programs, but apparently
some HP printers do use these port numbers. A {\bf netstat -a} on the Storage
daemon's machine can determine who is using the 9103 port (used for FD to SD
-communications in Bacula).
+communications in Bacula).
\section{Daemon Command Line Options}
\index[general]{Daemon Command Line Options }
Each of the three daemons (Director, File, Storage) accepts a small set of
options on the command line. In general, each of the daemons as well as the
-Console program accepts the following options:
+Console program accepts the following options:
\begin{description}
\item [-c \lt{}file\gt{}]
\index[sd]{-c \lt{}file\gt{} }
Define the file to use as a configuration file. The default is the daemon
- name followed by {\bf .conf} i.e. {\bf bacula-dir.conf} for the Director,
+ name followed by {\bf .conf} i.e. {\bf bacula-dir.conf} for the Director,
{\bf bacula-fd.conf} for the File daemon, and {\bf bacula-sd} for the Storage
- daemon.
+ daemon.
\item [-d nn]
\index[sd]{-d nn }
Set the debug level to {\bf nn}. Higher levels of debug cause more
- information to be displayed on STDOUT concerning what the daemon is doing.
+ information to be displayed on STDOUT concerning what the daemon is doing.
\item [-f]
Run the daemon in the foreground. This option is needed to run the daemon
- under the debugger.
+ under the debugger.
\item [-g <group>]
Run the daemon under this group. This must be a group name, not a GID.
\item [-s]
Do not trap signals. This option is needed to run the daemon under the
- debugger.
+ debugger.
\item [-t]
Read the configuration file and print any error messages, then immediately
- exit. Useful for syntax testing of new configuration files.
+ exit. Useful for syntax testing of new configuration files.
\item [-u <user>]
Run the daemon as this user. This must be a user name, not a UID.
\item [-v]
Be more verbose or more complete in printing error and informational
- messages. Recommended.
+ messages. Recommended.
\item [-?]
- Print the version and list of options.
+ Print the version and list of options.
\end{description}
\index[general]{Creating a Pool }
Creating the Pool is automatically done when {\bf Bacula} starts, so if you
-understand Pools, you can skip to the next section.
+understand Pools, you can skip to the next section.
When you run a job, one of the things that Bacula must know is what Volumes to
use to backup the FileSet. Instead of specifying a Volume (tape) directly, you
next volume and so on. If no appendable Volume exists in the Pool, the
Director will attempt to recycle an old Volume, if there are still no
appendable Volumes available, {\bf Bacula} will send a message requesting the
-operator to create an appropriate Volume.
+operator to create an appropriate Volume.
{\bf Bacula} keeps track of the Pool name, the volumes contained in the Pool,
-and a number of attributes of each of those Volumes.
+and a number of attributes of each of those Volumes.
When Bacula starts, it ensures that all Pool resource definitions have been
-recorded in the catalog. You can verify this by entering:
+recorded in the catalog. You can verify this by entering:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
list pools
-\end{verbatim}
+\end{lstlisting}
\normalsize
-to the console program, which should print something like the following:
+to the console program, which should print something like the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
*list pools
Using default Catalog name=MySQL DB=bacula
+--------+---------+---------+---------+----------+-------------+
| 2 | File | 12 | 12 | Backup | File |
+--------+---------+---------+---------+----------+-------------+
*
-\end{verbatim}
+\end{lstlisting}
\normalsize
If you attempt to create the same Pool name a second time, {\bf Bacula} will
-print:
+print:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Error: Pool Default already exists.
Once created, you may use the {\bf update} command to
modify many of the values in the Pool record.
-\end{verbatim}
+\end{lstlisting}
\normalsize
\label{Labeling}
command in the Console program to label a new Volume and to define it in the
Pool database, after which Bacula will begin writing on the new Volume.
Alternatively, I can use the Console {\bf relabel} command to relabel a Volume
-that is no longer used providing it has VolStatus {\bf Purged}.
+that is no longer used providing it has VolStatus {\bf Purged}.
Another strategy is to label a set of volumes at the start, then use them as
{\bf Bacula} requests them. This is most often done if you are cycling through
a set of tapes, for example using an autochanger. For more details on
-recycling, please see the
+recycling, please see the
\ilink{Automatic Volume Recycling}{RecyclingChapter} chapter of
-this manual.
+this manual.
If you run a Bacula job, and you have no labeled tapes in the Pool, Bacula
will inform you, and you can create them "on-the-fly" so to speak. In my
case, I label my tapes with the date, for example: {\bf DLT-18April02}. See
-below for the details of using the {\bf label} command.
+below for the details of using the {\bf label} command.
\section{Labeling Volumes with the Console Program}
\index[general]{Labeling Volumes with the Console Program }
\index[general]{Program!Labeling Volumes with the Console }
-Labeling volumes is normally done by using the console program.
+Labeling volumes is normally done by using the console program.
\begin{enumerate}
-\item ./bconsole
-\item label
+\item ./bconsole
+\item label
\end{enumerate}
If Bacula complains that you cannot label the tape because it is already
labeled, simply {\bf unmount} the tape using the {\bf unmount} command in the
console, then physically mount a blank tape and re-issue the {\bf label}
-command.
+command.
Since the physical storage media is different for each device, the {\bf label}
command will provide you with a list of the defined Storage resources such as
-the following:
+the following:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
The defined Storage resources are:
1: File
2: 8mmDrive
3: DLTDrive
4: SDT-10000
Select Storage resource (1-4):
-\end{verbatim}
+\end{lstlisting}
\normalsize
At this point, you should have a blank tape in the drive corresponding to the
-Storage resource that you select.
+Storage resource that you select.
-It will then ask you for the Volume name.
+It will then ask you for the Volume name.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Enter new Volume name:
-\end{verbatim}
+\end{lstlisting}
\normalsize
-If Bacula complains:
+If Bacula complains:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Media record for Volume xxxx already exists.
-\end{verbatim}
+\end{lstlisting}
\normalsize
It means that the volume name {\bf xxxx} that you entered already exists in
the Media database. You can list all the defined Media (Volumes) with the {\bf
list media} command. Note, the LastWritten column has been truncated for
-proper printing.
+proper printing.
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
+---------------+---------+--------+----------------+-----/~/-+------------+-----+
| VolumeName | MediaTyp| VolStat| VolBytes | LastWri | VolReten | Recy|
+---------------+---------+--------+----------------+---------+------------+-----+
| DLT-04May2002 | DLT8000 | Full | 60,486,677,724 | 2002-05 | 31,536,000 | 0 |
| DLT-26May02 | DLT8000 | Append | 1,336,699,620 | 2002-05 | 31,536,000 | 1 |
+---------------+---------+--------+----------------+-----/~/-+------------+-----+
-\end{verbatim}
+\end{lstlisting}
\normalsize
Once Bacula has verified that the volume does not already exist, it will
If the tape is successfully labeled, a Volume record will also be created in
the Pool. That is the Volume name and all its other attributes will appear
when you list the Pool. In addition, that Volume will be available for backup
-if the MediaType matches what is requested by the Storage daemon.
+if the MediaType matches what is requested by the Storage daemon.
When you labeled the tape, you answered very few questions about it --
principally the Volume name, and perhaps the Slot. However, a Volume record in
the catalog database (internally known as a Media record) contains quite a few
attributes. Most of these attributes will be filled in from the default values
that were defined in the Pool (i.e. the Pool holds most of the default
-attributes used when creating a Volume).
+attributes used when creating a Volume).
It is also possible to add media to the pool without physically labeling the
Volumes. This can be done with the {\bf add} command. For more information,
-please see the
-\ilink{Console Chapter}{_ConsoleChapter} of this manual.
+please see the
+\bsysxrlink{Console}{_ConsoleChapter}{console}{chapter} of the \consoleman{}.