\index[general]{Labels!Tape}
\addcontentsline{toc}{section}{ANSI and IBM Tape Labels}
-Bacula can support ANSI or IBM tape labels as long as you
+Bacula supports ANSI or IBM tape labels as long as you
enable it. In fact, with the proper configuration, you can
force Bacula to require ANSI or IBM labels.
Even though Bacula will recognize and write ANSI and IBM labels,
it always writes its own tape labels as well.
-When using ANSI or IBM tape labeling, you must keep your Volume
+When using ANSI or IBM tape labeling, you must restrict your Volume
names to a maximum of 6 characters.
+If you have labeled your Volumes outside of Bacula, then the
+ANSI/IBM label will be recognized by Bacula only if you have created
+the HDR1 label with {\bf BACULA.DATA} in the Filename field (starting
+with character 5). If Bacula writes the labels, it will use
+this information to recognize the tape as a Bacula tape. This allows
+ANSI/IBM labeled tapes to be used at sites with multiple machines
+and multiple backup programs.
+
\subsection*{Director Pool Directive}
\addcontentsline{toc}{section}{Director Pool Directive}
\item [ Label Type = ANSI | IBM | Bacula]
This directive is implemented in the Director Pool resource and in the SD Device
resource. If it is specified in the SD Device resource, it will take
- precedence over the value passed from the Director to the SD.
+ precedence over the value passed from the Director to the SD. The default
+ is Label Type = Bacula.
\end{description}
\subsection*{Storage Daemon Device Directives}
This directive is implemented in the Director Pool resource and in the SD Device
resource. If it is specified in the the SD Device resource, it will take
precedence over the value passed from the Director to the SD.
-
+
\item [Check Labels = yes | no]
This directive is implemented in the the SD Device resource. If you intend
to read ANSI or IBM labels, this *must* be set. Even if the volume is
not ANSI labeled, you can set this to yes, and Bacula will check the
- label type.
+ label type. Without this directive set to yes, Bacula will assume that
+ labels are of Bacula type and will not check for ANSI or IBM labels.
+ In other words, if there is a possibility of Bacula encountering an
+ ANSI/IBM label, you must set this to yes.
\end{description}
The specified {\bf name-string} gives the system file name of the autochanger
device name. If specified in this resource, the Changer Device name
is not needed in the Device resource. If it is specified in the Device
- resource (see above), it will take precidence over one specified in
+ resource (see above), it will take precedence over one specified in
the Autochanger resource.
\item [Changer Command = {\it name-string}]
you will specify the Bacula supplied {\bf mtx-changer} script as follows.
If it is specified here, it need not be specified in the Device
resource. If it is specified in the Device resource, it will take
- precidence over the one specified in the Autochanger resource.
+ precedence over the one specified in the Autochanger resource.
\end{description}
the path to the {\bf Changer Command} to correspond to the values used on your
system.
+\subsection*{A Multi-drive Example Configuration File}
+\index[general]{Multi-drive Example Configuration File }
+\addcontentsline{toc}{subsection}{A Multi-drive Example Configuration File}
+
+The following resources implement a multi-drive autochanger:
+
+\footnotesize
+\begin{verbatim}
+Autochanger {
+ Name = "Autochanger"
+ Device = Drive-1, Drive-2
+ Changer Device = /dev/sg0
+ Changer Command = "/etc/bacula/mtx-changer %c %o %S %a %d"
+}
+
+Device {
+ Name = Drive-1
+ Drive Index = 0
+ Media Type = DDS-4
+ Archive Device = /dev/nst0 # Normal archive device
+ Autochanger = yes
+ LabelMedia = no;
+ AutomaticMount = yes;
+ AlwaysOpen = yes;
+ Mount Anonymous Volumes = no;
+}
+
+Device {
+ Name = Drive-2
+ Drive Index = 1
+ Media Type = DDS-4
+ Archive Device = /dev/nst1 # Normal archive device
+ Autochanger = yes
+ LabelMedia = no;
+ AutomaticMount = yes;
+ AlwaysOpen = yes;
+ Mount Anonymous Volumes = no;
+}
+
+\end{verbatim}
+\normalsize
+
+where you will adapt the {\bf Archive Device}, the {\bf Changer Device}, and
+the path to the {\bf Changer Command} to correspond to the values used on your
+system.
\label{SpecifyingSlots}
\subsection*{Specifying Slots When Labeling}
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
+ never relabel a Bacula labeled tape unless it is recycled and you use the
{\bf relabel} command).
\item There is no tape in the drive.
\end{enumerate}
-There are two ways to relabel a volume that already has a Bacula label. The
+There are two ways to relabel a volume that already has a Bacula label. The
brute force method is to write an end of file mark on the tape using the
system {\bf mt} program, something like the following:
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'' command, will be
-treated as a cleaning tape, and will not be labeled. For example with:
+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}
command can be dangerous because you can delete catalog records associated
with current backups of files, and we recommend that you do not use it
unless you know what you are doing. The permitted forms of {\bf purge} are:
-purge files
-jobid=\lt{}jobid\gt{}|job=\lt{}job-name\gt{}|client=\lt{}client-name\gt{}
+
+purge files jobid=\lt{}jobid\gt{}|job=\lt{}job-name\gt{}|client=\lt{}client-name\gt{}
purge jobs client=\lt{}client-name\gt{} (of all jobs)
This command is used to label physical volumes. The full form of this command
is:
-relabel storage=\lt{}storage-name\gt{} volume=\lt{}newvolume-name\gt{}
-name=\lt{}old-volume-name\gt{}
-
+relabel storage=\lt{}storage-name\gt{} oldvolume=\lt{}old-volume-name\gt{}
+ volume=\lt{}newvolume-name\gt{}
+
If you leave out any part, you will be prompted for it. In order for the
Volume (old-volume-name) to be relabeled, it must be in the catalog, and the
volume status must be marked {\bf Purged} or {\bf Recycle}. This happens
automatically as a result of applying retention periods, or you may
explicitly purge the volume using the {\bf purge} command.
-Once the volume is physically relabeled, the old data written on the Volume
-is lost and cannot be recovered.
+Once the volume is physically relabeled, the old data previously written
+on the Volume is lost and cannot be recovered.
\item [release]
\index[console]{release }
Device = "HP DLT 80" # same as Device in Storage daemon
Media Type = DLT8000 # same as MediaType in Storage daemon
}
+# Definition for a DLT autochanger device
+Storage {
+ Name = Autochanger
+ Address = rufus
+ Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
+ Device = "Autochanger" # same as Device in Storage daemon
+ Media Type = DLT-8000 # Different from DLTDrive
+ Autochanger = yes
+}
# Definition of DDS tape storage device
Storage {
Name = SDT-10000
Yes, Bacula compiles and runs on Windows machines (Win98, WinMe, WinXP,
WinNT, and Win2000). We provide a binary version of the Client (bacula-fd),
but have not tested the Director nor the Storage daemon. Note, Win95 is no
- longer supported because it doesn't have the GetFileAttributesExA API call.
+ longer supported because it doesn't have the GetFileAttributesExA API call.
+
\label{lang}
\item [What language is Bacula written in?]
\index[general]{What language is Bacula written in? }
- It is written in C++, but it is mostly C code using only a limited set of the
- C++ extensions over C. Thus Bacula is completely compiled using the C++
- compiler. There are several modules, including the Win32 interface, that
+ It is written in C++, but it is mostly C code using only a limited set of
+ the C++ extensions over C. Thus Bacula is completely compiled using the
+ C++ compiler. There are several modules, including the Win32 interface, that
are written using the object oriented C++ features. Over time, we are slowly
adding a larger subset of C++.
\item [On what machines does Bacula run? ]
\index[general]{On what machines does Bacula run? }
{\bf Bacula} builds and executes on RedHat Linux (versions RH7.1-RHEL 3.0,
- SUSE, Gentoo, Debian, Mandriva, ...), FreeBSD, Solaris, Alpha, SGI (client),
+ SuSE, Gentoo, Debian, Mandriva, ...), FreeBSD, Solaris, Alpha, SGI (client),
NetBSD, OpenBSD, Mac OS X (client), and Win32 (client).
- Bacula has been my only backup tool for over four years backing up 5 machines
- nightly (3 Linux boxes running RedHat, a WinXP machine, and a WinNT machine).
+ Bacula has been my only backup tool for over four years backing up 5
+ machines nightly (3 Linux boxes running RedHat, a WinXP machine, and a WinNT
+ machine).
\label{stable}
unimplemented or partially implemented features. With a program of this size
(100,000+ lines of C++ code not including the SQL programs) there are bound
to be bugs. The current test environment (a twisted pair local network and a
- HP DLT backup tape) is not exactly ideal, so additional testing on other sites is
- necessary. The File daemon has never crashed -- running months at a time with
+ HP DLT backup tape) is not exactly ideal, so additional testing on other
+sites is
+ necessary. The File daemon has never crashed -- running months at a time
+with
no intervention. The Storage daemon is remarkably stable with most of the
problems arising during labeling or switching tapes. Storage daemon crashes
- are rare. The Director, given the multitude of functions it fulfills is also
+ are rare. The Director, given the multitude of functions it fulfills is
+also
relatively stable. In a production environment, it rarely if ever crashes. Of
- the three daemons, the Director is the most prone to having problems. Still, it
+ the three daemons, the Director is the most prone to having problems. Still,
+it
frequently runs several months with no problems.
There are a number of reasons for this stability.
\item All memory leaks (orphaned buffers) are reported each time the
program terminates.\\
\item Any signal (segmentation fault, ...) generates a
- traceback that is emailed to the developer. This permits quick resolution of
+ traceback that is emailed to the developer. This permits quick resolution
+of
bugs even if they only show up rarely in a production system.\\
\item There is a reasonably comprehensive set of regression tests
that avoids re-creating the most common errors in new versions of
\item It is a Windows Client, and the client died because of an improper
configuration file. Check that the Bacula icon is in the system tray and the
the menu items work. If the client has died, the icon will disappear only
-when you move the mouse over the icon.
+ when you move the mouse over the icon.
\item The Client address or port is incorrect or not resolved by DNS. See if
you can ping the client machine using the same address as in the Client
record.
\item Your password or names are not correct in both the Director and the
Client machine. Try configuring everything identical to how you run the
client on the same machine as the Director, but just change the Address. If
-that works, make the other changes one step at a time until it works.
+ that works, make the other changes one step at a time until it works.
+\item You may also be having problems betwen your File daemon and your
+ Storage daemon. The name you use in the Storage resource of your
+ Director's conf file must be known (resolvable) by the File daemon,
+ because it is passed symbolically to the File daemon, which then
+ resolves it to get an IP address used to contact the Storage daemon.
\end{itemize}
\label{startover}
you for the tape, and if the wrong one is mounted, it will inform you.
If you have previously done an {\bf unmount} command, all Storage daemon
- sessions (jobs) will be completely blocked from using the drive unmounted, so
- be sure to do a {\bf mount} after your unmount. If in doubt, do a second {\bf
+ sessions (jobs) will be completely blocked from using the drive unmounted,
+so
+ be sure to do a {\bf mount} after your unmount. If in doubt, do a second
+{\bf
mount}, it won't cause any harm.
\label{windowstart}
\label{scroll}
\item [When I Start the Console, the Error Messages Fly By. How can I see
them? ]
- \index[general]{When I Start the Console, the Error Messages Fly By. How can I see them? }
- Either use a shell window with a scroll bar, or use the gnome-console. In any
+ \index[general]{When I Start the Console, the Error Messages Fly By. How can
+I see them? }
+ Either use a shell window with a scroll bar, or use the gnome-console. In
+any
case, you probably should be logging all output to a file, and then you can
simply view the file using an editor or the {\bf less} program. To log all
output, I have the following in my Director's Message resource definition:
but can grow as needed to handle any length. Most of the work is
carried out by lower level routines making the coding rather easy.
+ Note that due to limitations Win32 path and filenames cannot exceed
+ 260 characters. By using Win32 Unicode functions, we will remove this
+ restriction in later versions of Bacula.
+
\label{unique}
-\item [What Is the Really Unique Feature of Bacula? ]
+\item [What Is the Really Unique Feature of Bacula?]
\index[general]{What Is the Really Unique Feature of Bacula? } Well, it
is hard to come up with unique features when backup programs for Unix
machines have been around since the 1960s. That said, I believe that
implemented, this will enormously reduce tape usage.
\label{sequence}
-
\item [If I Do Run Multiple Simultaneous Jobs, How Can I Force One
Particular Job to Run After Another Job? ]
\index[general]{If I Do Run Multiple Simultaneous Jobs, How Can I Force One
\item [I Change Recycling, Retention Periods, or File Sizes in my Pool
Resource and they Still Don``t Work.]
- \index[general]{I Change Recycling, Retention Periods, or File Sizes in my Pool
+ \index[general]{I Change Recycling, Retention Periods, or File Sizes in my
+Pool
Resource and they Still Don"t Work. }
The different variables associated with a Pool are defined in the Pool
Resource, but are actually read by Bacula from the Catalog database. On
the tape drive hardware, and you either enable or disable it with system
tools such as {\bf mt}. This compression works independently of Bacula.
- Bacula also has compression code, which is normally used only when backing up
+ Bacula also has compression code, which is normally used only when backing
+up
to file Volumes. There are two conditions for this ''software`` to become
enabled.
\begin{itemize}
\item There is an I/O error on the tape. Bacula prints an error message and
- requests a new tape. Bacula does not attempt to continue writing after an I/O
+ requests a new tape. Bacula does not attempt to continue writing after an
+I/O
error.
\item Bacula encounters and end of medium on the tape. This is not always
distinguishable from an I/O error.
\end{itemize}
\label{LevelChanging}
-
\item [Bacula is Not Doing the Right Thing When I Request an Incremental
Backup. Why?]
- \index[general]{Bacula is Not Doing the Right Thing When I Request an Incremental
+ \index[general]{Bacula is Not Doing the Right Thing When I Request an
+Incremental
Backup. Why? }
As explained in one of the previous questions, Bacula will automatically
- upgrade an Incremental or Differential job to a Full backup if it cannot find
+ upgrade an Incremental or Differential job to a Full backup if it cannot
+find
a prior Full backup or a suitable Full backup. For the gory details on
how/when Bacula decides to upgrade levels please see the
\ilink{Level record}{Level} in the Director's configuration
\label{WaitForever}
\item [I am Backing Up an Offsite Machine with an Unreliable Connection.
- The Director Waits Forever for the Client to Contact the SD. What Can I Do?]
- \index[general]{I am Backing Up an Offsite Machine with an Unreliable Connection.
+ The Director Waits Forever for the Client to Contact the SD. What Can I
+Do?]
+ \index[general]{I am Backing Up an Offsite Machine with an Unreliable
+Connection.
The Director Waits Forever for the Client to Contact the SD. What Can I Do?}
Bacula was written on the assumption that it will have a good TCP/IP
connection between all the daemons. As a consequence, the current Bacula
- doesn't deal with faulty connections very well. This situation is slowly being
+ doesn't deal with faulty connections very well. This situation is slowly
+being
corrected over time.
There are several things you can do to improve the situation.
\label{sshHanging}
\item [When I ssh into a machine and start Bacula then attempt to exit,
ssh hangs forever.]
- \index[general]{When I ssh into a machine and start Bacula then attempt to exit,
+ \index[general]{When I ssh into a machine and start Bacula then attempt to
+exit,
ssh hangs forever. }
This happens because Bacula leaves stdin, stdout, and stderr open for debug
purposes. To avoid it, the simplest thing to do is to redirect the output of
\item [I'm confused by the different Retention periods: File Retention,
Job Retention, Volume Retention. Why are there so many?]
- \index[general]{I'm confused by the different Retention periods: File Retention,
+ \index[general]{I'm confused by the different Retention periods: File
+Retention,
Job Retention, Volume Retention. Why are there so many? }
Yes, this certainly can be confusing. The basic reason for so many is to
- allow flexibility. The File records take quite a lot of space in the catalog,
+ allow flexibility. The File records take quite a lot of space in the
+catalog,
so they are typically records you want to remove rather quickly. The Job
- records, take very little space, and they can be useful even without the File
+ records, take very little space, and they can be useful even without the
+File
records to see what Jobs actually ran and when. One must understand that if
the File records are removed from the catalog, you cannot use the {\bf
restore} command to restore an individual file since Bacula no longer knows
- where it is. However, as long as the Volume Retention period has not expired,
+ where it is. However, as long as the Volume Retention period has not
+expired,
the data will still be on the tape, and can be recovered from the tape.
- For example, I keep a 30 day retention period for my Files to keep my catalog
+ For example, I keep a 30 day retention period for my Files to keep my
+catalog
from getting too big, but I keep my tapes for a minimum of one year, just in
case.
\item [Why Does Bacula Ignore the MaxVolumeSize Set in my Pool?]
\index[general]{Why Does Bacula Ignore the MaxVolumeSize Set in my Pool? }
The MaxVolumeSize that Bacula uses comes from the Media record, so most
- likely you changed your Pool, which is used as the default for creating Media
+ likely you changed your Pool, which is used as the default for creating
+Media
records, {\bf after} you created your Volume. Check what is in the Media
record by doing:
\label{ConnectionRefused}
\item [In connecting to my Client, I get ''ERR:Connection Refused. Packet
Size too big from File daemon:192.168.1.4:9102`` Why?]
- \index[general]{In connecting to my Client, I get &htmlQuoteERR:Connection Refused.
+ \index[general]{In connecting to my Client, I get &htmlQuoteERR:Connection
+Refused.
Packet Size too big from File daemon:192.168.1.4:9102&htmlQuote Why? }
- This is typically a communications error resulting from one of the following:
+ This is typically a communications error resulting from one of the
+following:
\begin{itemize}
This will cause the FD to write a file {\bf bacula.trace} in the current
directory, which you can examine to determine the problem.
+\item [During long running jobs my File daemon dies with Pipe Error, or
+ some other communications error. Why?]
+ \index[general]{Communications Errors}
+ \index[general]{Pipe Errors}
+ There are a number of reasons why a connection might break.
+ Most often, it is a router between your two computers that times out
+ inactive lines (not respecting the keepalive feature that Bacula uses).
+ In that case, you can use the {\bf Heartbeat Interval} directive in
+ both the Storage daemon and the File daemon.
+
+ In at least one case, the problem has been a bad driver for a Win32
+ NVidia NForce 3 ethernet card with driver (4.4.2 17/05/2004).
+ In this case, a good driver is (4.8.2.0 06/04/2005). Moral of
+ the story, make sure you have the latest ethernet drivers
+ loaded.
+
+ Lack of communications, or communications that get interrupted can
+ also be caused by Linux firewalls where you have a rule that throttles
+ connections or traffic. For example, if you have:
+
+\footnotesize
+\begin{verbatim}
+iptables -t filter -A INPUT -m limit --limit 3/second --limit-burst 3 -j DROP
+\end{verbatim}
+\normalsize
+
+ you will want to add the following rules {\bf before} the above rule:
+\footnotesize
+\begin{verbatim}
+iptables -t filter -A INPUT --dport 9101 -j ACCEPT
+iptables -t filter -A INPUT --dport 9102 -j ACCEPT
+iptables -t filter -A INPUT --dport 9103 -j ACCEPT
+\end{verbatim}
+\normalsize
+ This will ensure that any Bacula traffic will not get terminated because
+ of high usage rates.
+
+\item[I can't figure out how to tell the job which volume to use]
+ \index[general]{What tape to mount}
+ This is an interesting statement. I now see that a number of people new to
+ Bacula have the same problem as you, probably from using programs like tar.
+
+ In fact, you do not tell Bacula what tapes to use. It is the inverse. Bacula
+ tells you want tapes it wants. You put tapes at its disposition and it
+ chooses.
+
+ Now, if you *really* want to be tricky and try to tell Bacula what to do, it
+ will be reasonable if for example you mount a valid tape that it can use on a
+ drive, it will most likely go ahead and use it. It also has a documented
+ algorithm for choosing tapes -- but you are asking for problems ...
+
+ So, the trick is to invert your concept of things and put Bacula in charge of
+ handling the tapes. Once you do that, you will be fine. If you want to
+ anticipate what it is going to do, you can generally figure it out correctly
+ and get what you want.
+
+ If you start with the idea that you are going to force or tell Bacula to use
+ particular tapes or you insist on trying to run in that kind of mode, you will
+ probably not be too happy.
+
+ I don't want to worry about what tape has what data. That is what Bacula is
+ designed for.
+
+ If you have an application where you *really* need to remove a tape each day
+ and insert a new one, it can be done the directives exist to accomplish that.
+ In such a case, one little "trick" to knowing what tape Bacula will want at
+ 2am while you are asleep is to run a tiny job at 4pm while you are still at
+ work that backs up say one directory, or even one file. You will quickly find
+ out what tape it wants, and you can mount it before you go home ...
+
\end{description}
connection after a short duration despite the fact that keepalive is
set. This usually results in a broken pipe error message.
+ If you continue getting broken pipe error messages despite using the
+ Heartbeat Interval, and you are using Windows, you should consider
+ upgrading your ethernet driver. This is a known problem with NVidia
+ NForce 3 drivers (4.4.2 17/05/2004).
+
\item [Maximum Concurrent Jobs = \lt{}number\gt{}]
\index[fd]{Maximum Concurrent Jobs }
where \lt{}number\gt{} is the maximum number of Jobs that should run
If the vertical bar (|) in front of my\_partitions is preceded by a
backslash as in \textbackslash{}|, the program will be executed on the
- Client's machine instead of on the Director's machine -- (this is
- implemented but not thoroughly tested, and is reported to work on
- Windows). Please note that if the filename is given within quotes, you
+ Client's machine instead of on the Director's machine.
+ Please note that if the filename is given within quotes, you
will need to use two slashes. An example, provided by John Donagher,
that backs up all the local UFS partitions on a remote system is:
\end{verbatim}
\normalsize
- Note, it requires two backslash characters after the double quote (one
+ The above requires two backslash characters after the double quote (one
preserves the next one). If you are a Linux user, just change the {\bf ufs}
- to {\bf ext3} (or your preferred filesystem type) and you will be in
+ to {\bf ext3} (or your preferred filesystem type), and you will be in
business.
\item Any file-list item preceded by a less-than sign (\lt{}) will be taken
daemon, the Storage daemon, and the Console programs. If you have followed our
recommendations, default configuration files as well as the daemon binaries
will be located in your installation directory. In any case, the binaries are
-found in the directory you specified on the {\bf \verb:--:sbindir} option to the {\bf
+found in the directory you specified on the {\bf \verb:--:sbindir} option to the
+{\bf
./configure} command, and the configuration files are found in the directory
you specified on the {\bf \verb:--:sysconfdir} option.
and to manually start/stop Jobs or to obtain Job status information.
The Console configuration file is found in the directory specified on the {\bf
-\verb:--:sysconfdir} option that you specified on the {\bf ./configure} command and
+\verb:--:sysconfdir} option that you specified on the {\bf ./configure} command
+and
by default is named {\bf console.conf}.
-If you choose to build the GNOME console with the {\bf \verb:--:enable-gnome} option,
+If you choose to build the GNOME console with the {\bf \verb:--:enable-gnome}
+option,
you also find a default configuration file for it, named {\bf
gnome-console.conf}.
The same applies to the wxWidgets console, which is build with the {\bf
-\verb:--:enable-wx-console} option, and the name of the default configuration file
+\verb:--:enable-wx-console} option, and the name of the default configuration
+file
is, in this case, {\bf wx-console.conf}.
Normally, for first time users, no change is needed to these files. Reasonable
daemon (MainSD) that is currently selected.
The Monitor configuration file is found in the directory specified on the {\bf
-\verb:--:sysconfdir} option that you specified on the {\bf ./configure} command and
+\verb:--:sysconfdir} option that you specified on the {\bf ./configure} command
+and
by default is named {\bf tray-monitor.conf}. Normally, for first time users,
you just need to change the permission of this file to allow non-root users to
run the Monitor, as this application must run as the same user as the
data) to the Storage daemon.
The File daemon configuration file is found in the directory specified on the
-{\bf \verb:--:sysconfdir} option that you specified on the {\bf ./configure} command.
+{\bf \verb:--:sysconfdir} option that you specified on the {\bf ./configure}
+command.
By default, the File daemon's configuration file is named {\bf
bacula-fd.conf}. Normally, for first time users, no change is needed to this
file. Reasonable defaults are set. However, if you are going to back up more
schedules and monitors all jobs to be backed up.
The Director configuration file is found in the directory specified on the
-{\bf \verb:--:sysconfdir} option that you specified on the {\bf ./configure} command.
+{\bf \verb:--:sysconfdir} option that you specified on the {\bf ./configure}
+command.
Normally the Director's configuration file is named {\bf bacula-dir.conf}.
In general, the only change you must make is modify the FileSet resource so
The new pthreads library {\bf /lib/tls} installed by default on recent Red Hat
systems running kernel 2.4.x is defective. You must remove it or rename it,
then reboot your system before running Bacula otherwise after a week or so of
-running, Bacula will either block for long periods or deadlock entirely. The
-feedback that we have concerning 2.6 kernels is the same. However, on 2.6
-systems, you may want to use the loader environment variable override rather
-than removing /lib/tls. Please see
-\ilink{ Supported Operating Systems}{SupportedOSes} for more
+running, Bacula will either block for long periods or deadlock entirely.
+You may want to use the loader environment variable override rather
+than removing /lib/tls. Please see \ilink{ Supported Operating
+Systems}{SupportedOSes} for more
information on this problem.
+
+This problem does not seem to occur on systems running 2.6.x kernels.
+
\label{Running1}
\subsection*{Running Bacula}
\index[general]{General }
\addcontentsline{toc}{subsection}{General}
-Below, we will discuss restoring files with the Console {\bf Restore} command,
+Below, we will discuss restoring files with the Console {\bf restore} command,
which is the recommended way of doing it. However, there is a standalone
program named {\bf bextract}, which also permits restoring files. For more
information on this program, please see the
a predefined {\bf restore} job in your {\bf bacula-dir.conf} (Director's
config) file. The exact parameters (Client, FileSet, ...) that you define are
not important as you can either modify them manually before running the job or
-if you use the {\bf restore} command, explained below, they will be
-automatically set for you.
+if you use the {\bf restore} command, explained below, Bacula will
+automatically set them for you.
Since Bacula is a network backup program, you must be aware that when you
restore files, it is up to you to ensure that you or Bacula have selected the
the files to a different directory on client B. Normally, you will want to
avoid this, but assuming the operating systems are not too different in their
file structures, this should work perfectly well, if so desired.
-\label{Example1}
+By default, Bacula will restore data to the same Client that was backed
+up, and those data will be restored not to the original places but to
+{\bf /tmp/bacula-restores}. You may modify any of these defaults when the
+restore command prompts you to run the job by selecting the {\bf mod}
+option.
+\label{Example1}
\subsection*{The Restore Command}
\index[general]{Command!Restore }
\index[general]{Restore Command }
restored. This mode is somewhat similar to the standard Unix {\bf restore}
program's interactive file selection mode.
+If your Files have been pruned, the {\bf restore} command will be unable
+to find any files to restore. See below for more details on this.
+
Within the Console program, after entering the {\bf restore} command, you are
presented with the following selection prompt:
To select the JobIds, you have the following choices:
1: List last 20 Jobs run
2: List Jobs where a given File is saved
- 3: Enter list of JobIds to select
+ 3: Enter list of comma separated JobIds to select
4: Enter SQL list command
5: Select the most recent backup for a client
6: Select backup for a client before a specified time
7: Enter a list of files to restore
8: Enter a list of files to restore before a specified time
- 9: Cancel
-Select item: (1-9):
-
+ 9: Find the JobIds of the most recent backup for a client
+ 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}
\normalsize
\begin{itemize}
-\item Item 1 will list the last 20 jobs run. If you find the Job you want,
+\item Item 1 will list the last 20 jobs run. If you find the Job you want,
you can then select item 3 and enter its JobId(s).
\item Item 2 will list all the Jobs where a specified file is saved. If you
- find the Job you want, you can then select item 3 and enter the JobId.
+ find the Job you want, you can then select item 3 and enter the JobId.
\item Item 3 allows you the enter a list of comma separated JobIds whose
- files will be put into the directory tree.
+ files will be put into the directory tree. You may then select which
+ files from those JobIds to restore.
\item Item 4 allows you to enter any arbitrary SQL command. This is probably
the most primitive way of finding the desired JobIds, but at the same time,
the most flexible. Once you have found the JobId(s), you can select item 3
-and enter them.
+ and enter them.
\item Item 5 will automatically select the most recent Full backup and all
- subsequent incremental and differential backups for a specified Client. These
- are the Jobs and Files which, if reloaded, will restore your system to the most
-current saved state. It automatically enters the JobIds found into the
-directory tree. This is probably the most convenient of all the above options
-to use if you wish to restore a selected Client to its most recent state.
+ subsequent incremental and differential backups for a specified Client.
+ These are the Jobs and Files which, if reloaded, will restore your
+ system to the most current saved state. It automatically enters the
+ JobIds found into the directory tree. This is probably the most
+ convenient of all the above options to use if you wish to restore a
+ selected Client to its most recent state.
+
+ There are two important things to note. First, this automatic selection
+ will never select a job that failed (terminated with an error status).
+ If you have such a job and want to recover one or more files from it,
+ you will need to explicitly enter the JobId in item 3, then choose the
+ files to restore.
+
+ If some of the Jobs that are needed to do the restore have had their
+ File records pruned, the restore will be incomplete. Bacula currently
+ does not correctly detect this condition. You can however, check for
+ this by looking carefully at the list of Jobs that Bacula selects and
+ prints. If you find Jobs with the JobFiles column set to zero, when
+ files should have been backed up, then you should expect problems.
+
+ If all the File records have been pruned, Bacula will realize that there
+ are no file records in any of the JobIds chosen and will inform you. It
+ will then propose doing a full restore (non-selective) of those JobIds.
+ This is possible because Bacula still knows where the beginning of the
+ Job data is on the Volumes, even if it does not know where particular
+ files are located.
+
\item Item 6 allows you to specify a date and time, after which Bacula will
automatically select the most recent Full backup and all subsequent
incremental and differential backups that started before the specified date
-and time.
+ and time.
\item Item 7 allows you to specify one or more filenames (complete path
required) to be restored. Each filename is entered one at a time or if you
prefix a filename with the less-than symbol (\lt{}) Bacula will read that
-file and assume it is a list of filenames to be restored. The filename entry
-mode is terminated by entering a blank line.
+ file and assume it is a list of filenames to be restored. The filename entry
+ mode is terminated by entering a blank line.
\item Item 8 allows you to specify a date and time before entering the
filenames. See Item 7 above for more details.
-\item Item 9 allows you to cancel the restore command.
- \end{itemize}
+\item Item 9 allows you find the JobIds of the most recent backup for
+ a client. This is much like option 5 (it uses the same code), but
+ those JobIds are retained internally as if you had entered them
+ manually. You may then select item 11 (see below) to restore one
+ or more directories.
+\item Item 10 is the same as item 9, except that it allows you to enter
+ a before date (as with item 6). These JobIds will then be retained
+ internally.
+\item Item 11 allows you to enter a list of JobIds from which you can
+ select directories to be restored. The list of JobIds can have been
+ previously created by using either item 9 or 10 on the menu. You
+ may then enter a full path to a directory name or a filename preceded
+ by a less than sign (\lt{}). The filename should contain a list
+ of directories to be restored. All files in those directories will
+ be restored, but if the directory contains subdirectories, nothing
+ will be restored in the subdirectory unless you explicitly enter its
+ name.
+\item Item 12 allows you to cancel the restore command.
+\end{itemize}
As an example, suppose that we select item 5 (restore to most recent state).
It will then ask for the desired Client, which on my system, will print all
\footnotesize
\begin{verbatim}
-+-------+------+----------+-------------+-------------+------+-------+------------+
-| JobId | Levl | JobFiles | StartTime | VolumeName | File | SesId | VolSesTime |
-+-------+------+----------+-------------+-------------+------+-------+------------+
-| 1,792 | F | 128,374 | 08-03 01:58 | DLT-19Jul02 | 67 | 18 | 1028042998 |
-| 1,792 | F | 128,374 | 08-03 01:58 | DLT-04Aug02 | 0 | 18 | 1028042998 |
-| 1,797 | I | 254 | 08-04 13:53 | DLT-04Aug02 | 5 | 23 | 1028042998 |
-| 1,798 | I | 15 | 08-05 01:05 | DLT-04Aug02 | 6 | 24 | 1028042998 |
-+-------+------+----------+-------------+-------------+------+-------+------------+
++-------+------+----------+-------------+-------------+------+-------+----------
+--+
+| JobId | Levl | JobFiles | StartTime | VolumeName | File | SesId |
+VolSesTime |
++-------+------+----------+-------------+-------------+------+-------+----------
+--+
+| 1,792 | F | 128,374 | 08-03 01:58 | DLT-19Jul02 | 67 | 18 |
+1028042998 |
+| 1,792 | F | 128,374 | 08-03 01:58 | DLT-04Aug02 | 0 | 18 |
+1028042998 |
+| 1,797 | I | 254 | 08-04 13:53 | DLT-04Aug02 | 5 | 23 |
+1028042998 |
+| 1,798 | I | 15 | 08-05 01:05 | DLT-04Aug02 | 6 | 24 |
+1028042998 |
++-------+------+----------+-------------+-------------+------+-------+----------
+--+
You have selected the following JobId: 1792,1792,1797
Building directory tree for JobId 1792 ...
Building directory tree for JobId 1797 ...
\normalsize
Depending on the number of {\bf JobFiles} for each JobId, the {\bf Building
-directory tree ...``} can take a bit of time.
+directory tree ...``} can take a bit of time. If you notice ath all the
+JobFiles are zero, your Files have probably been pruned and you will not be
+able to select any individual files -- it will be restore everything or
+nothing.
In our example, Bacula found four Jobs that comprise the most recent backup of
the specified Client and FileSet. Two of the Jobs have the same JobId because
tells you that the current working directory ({\bf cwd}) is /. Finally, Bacula
prompts with the dollar sign (\$) to indicate that you may enter commands to
move around the directory tree and to select files.
+
+If you want all the files to automatically be marked when the directory
+tree is built, enter the command {\bf restore all}.
Instead of choosing item 5 on the first menu (Select the most recent backup
for a client), if we had chosen item 3 (Enter list of JobIds to select) and we
had entered the JobIds {\bf 1792,1797,1798} we would have arrived at the same
-point.
+point.
One point to note, if you are manually entering JobIds, is that you must enter
them in the order they were run (generally in increasing JobId order). If you
Jobs, you may end up with an old version of that file (i.e. not the most
recent).
+Directly entering the JobIds can also permit you to recover data from
+a Job that wrote files to tape but that terminated with an error status.
+
While in file selection mode, you can enter {\bf help} or a question mark (?)
to produce a summary of the available commands:
\footnotesize
\begin{verbatim}
- Command Description
+ Command Description
======= ===========
cd change current directory
count count marked files in and below the cd
- dir list current directory
+ dir long list current directory, wildcards allowed
done leave file selection mode
estimate estimate restore size
- exit exit = done
- find find files -- wildcards allowed
+ exit same as done command
+ find find files, wildcards allowed
help print help
- ls list current directory -- wildcards allowed
+ ls list current directory, wildcards allowed
lsmark list the marked files in and below the cd
- mark mark file to be restored
- markdir mark directory entry to be restored -- nonrecursive
+ mark mark dir/file to be restored recursively in dirs
+ markdir mark directory name to be restored (no files)
pwd print current working directory
- unmark unmark file to be restored
- unmarkdir unmark directory -- no recursion
- quit quit
+ unmark unmark dir/file to be restored recursively in dir
+ unmarkdir unmark directory name only no recursion
+ quit quit and do not do restore
? print help
-
\end{verbatim}
\normalsize
-As a default no files have been selected for restore. If you want to restore
+As a default no files have been selected for restore (unless you
+added {\bf all} to the command line. If you want to restore
everything, at this point, you should enter {\bf mark *}, and then {\bf done}
and {\bf Bacula} will write the bootstrap records to a file and request your
approval to start a restore job.
\normalsize
Please examine each of the items very carefully to make sure that they are
-correct. In particular, look at {\bf Where}, which tells you where in the
-directory structure the files will be restored, and {\bf Client}, which tells
-you which client will receive the files. These items will not always be
-completed with the correct values depending on which of the restore options
-you chose.
+correct. In particular, look at {\bf Where}, which tells you where in the
+directory structure the files will be restored, and {\bf Client}, which
+tells you which client will receive the files. Note that by default the
+Client which will receive the files is the Client that was backed up.
+These items will not always be completed with the correct values depending
+on which of the restore options you chose. You can change any of these
+default items by entering {\bf mod} and responding to the prompts.
The above assumes that you have defined a {\bf Restore} Job resource in your
Director's configuration file. Normally, you will only need one Restore Job
To select the JobIds, you have the following choices:
1: List last 20 Jobs run
2: List Jobs where a given File is saved
- 3: Enter list of JobIds to select
+ 3: Enter list of comma separated JobIds to select
4: Enter SQL list command
5: Select the most recent backup for a client
6: Select backup for a client before a specified time
7: Enter a list of files to restore
8: Enter a list of files to restore before a specified time
- 9: Cancel
-Select item: (1-9): 7
+ 9: Find the JobIds of the most recent backup for a client
+ 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}
\normalsize
\normalsize
If in modifying the parameters for the Run Restore job, you find that Bacula
-asks you to enter a Job number, this is because you have no yet specified
+asks you to enter a Job number, this is because you have not yet specified
either a Job number or a Bootstrap file. Simply entering zero will allow you
to continue and to select another option to be modified.
\label{CommandArguments}
Incremental saves run before the date you specify. Note, this command is not
too user friendly in that you must specify the date/time exactly as shown.
\item {\bf file=filename} -- specify a filename to be restored. You must
- specify the full path and filename. Prefixing the entry with a less-than sign
+ specify the full path and filename. Prefixing the entry with a less-than
+sign
(\lt{}) will cause Bacula to assume that the filename is on your system and
contains a list of files to be restored. Bacula will thus read the list from
that file. Multiple file=xxx specifications may be specified on the command
\item You are restoring into a directory that is already created and has file
creation restrictions. Bacula tries to reset everything but without walking
up the full chain of directories and modifying them all during the restore,
-which Bacula does and will not do, getting permissions back correctly in this
-situation depends to a large extent on your OS.
+ which Bacula does and will not do, getting permissions back correctly in
+this
+ situation depends to a large extent on your OS.
\item You selected one or more files in a directory, but did not select the
- directory entry to be restored. In that case, if the directory is not on disk
+ directory entry to be restored. In that case, if the directory is not on
+disk
Bacula simply creates the directory with some default attributes which may
-not be the same as the original. If you do not select a directory and all its
-contents to be restored, you can still select items within the directory to
-be restored by individually marking those files, but in that case, you should
-individually use the ''markdir`` command to select all higher level
-directory entries (one at a time) to be restored if you want the directory
-entries properly restored.
+ not be the same as the original. If you do not select a directory and all
+its
+ contents to be restored, you can still select items within the directory to
+ be restored by individually marking those files, but in that case, you
+should
+ individually use the ''markdir`` command to select all higher level
+ directory entries (one at a time) to be restored if you want the directory
+ entries properly restored.
\end{itemize}
\label{Windows}
with SYSTEM ownership and permissions. In this case, you may have problems
accessing the newly restored files.
-To avoid this problem, you should create any alternate directory before doing the
+To avoid this problem, you should create any alternate directory before doing
+the
restore. Bacula will not change the ownership and permissions of the directory
if it is already created as long as it is not one of the directories being
restored (i.e. written to tape).
the file as Bacula is restoring it.
For all the above reasons the restore process is generally much slower than
-backing up.
+backing up (sometimes it takes three times as long).
\subsection*{Problems Restoring Files}
\index[general]{Files!Problems Restoring }
\item Set ''Block Positioning = no`` in your Device resource and try the
restore. This is a new directive and untested.
\item Set ''Minimum Block Size = 512`` and ''Maximum Block Size = 512`` and
- try the restore. Again send me the full job report output. If you are able to
+ try the restore. Again send me the full job report output. If you are able
+to
determine the block size your drive was previously using, you should try
-that size if 512 does not work.
+ that size if 512 does not work.
\item Try editing the restore.bsr file at the Run xxx yes/mod/no prompt
- before starting the restore job and remove all the VolBlock statements. These
+ before starting the restore job and remove all the VolBlock statements.
+These
are what causes Bacula to reposition the tape, and where problems occur if
-you have a fixed block size set for your drive. The VolFile commands also
-cause repositioning, but this will work regardless of the block size.
+ you have a fixed block size set for your drive. The VolFile commands also
+ cause repositioning, but this will work regardless of the block size.
\item Use bextract to extract the files you want -- it reads the Volume
sequentially if you use the include list feature, or if you use a .bsr file,
- but remove all the VolBlock statements after the .bsr file is created (at the
-Run yes/mod/no) prompt but before you start the restore.
+ but remove all the VolBlock statements after the .bsr file is created (at
+the
+ Run yes/mod/no) prompt but before you start the restore.
\end{enumerate}
\subsection*{Example Restore Job Resource}
\begin{description}
\item [cd]
- The {\bf cd} command changes the current directory to the argument specified.
+ The {\bf cd} command changes the current directory to the argument
+specified.
It operates much like the Unix {\bf cd} command. Wildcard specifications are
-not permitted.
+ not permitted.
-Note, on Windows systems, the various drives (c:, d:, ...) are treated like a
-directory within the file tree while in the file selection mode. As a
-consequence, you must do a {\bf cd c:} or possibly in some cases a {\bf cd
-C:} (note upper case) to get down to the first directory.
+ Note, on Windows systems, the various drives (c:, d:, ...) are treated like
+a
+ directory within the file tree while in the file selection mode. As a
+ consequence, you must do a {\bf cd c:} or possibly in some cases a {\bf cd
+ C:} (note upper case) to get down to the first directory.
\item [dir]
\index[dir]{dir }
The {\bf dir} command is similar to the {\bf ls} command, except that it
-prints it in long format (all details). This command can be a bit slower than
-the {\bf ls} command because it must access the catalog database for the
-detailed information for each file.
+ prints it in long format (all details). This command can be a bit slower
+than
+ the {\bf ls} command because it must access the catalog database for the
+ detailed information for each file.
\item [estimate]
\index[dir]{estimate }
The {\bf estimate} command prints a summary of the total files in the tree,
-how many are marked to be restored, and an estimate of the number of bytes to
-be restored. This can be useful if you are short on disk space on the machine
-where the files will be restored.
+ how many are marked to be restored, and an estimate of the number of bytes
+to
+ be restored. This can be useful if you are short on disk space on the
+machine
+ where the files will be restored.
\item [find]
\index[dir]{find }
The {\bf find} command accepts one or more arguments and displays all files
-in the tree that match that argument. The argument may have wildcards. It is
-somewhat similar to the Unix command {\bf find / -name arg}.
+ in the tree that match that argument. The argument may have wildcards. It is
+ somewhat similar to the Unix command {\bf find / -name arg}.
\item [ls]
The {\bf ls} command produces a listing of all the files contained in the
current directory much like the Unix {\bf ls} command. You may specify an
-argument containing wildcards, in which case only those files will be listed.
-Any file that is marked to be restored will have its name preceded by an
-asterisk ({\bf *}). Directory names will be terminated with a forward slash
-({\bf /}) to distinguish them from filenames.
+ argument containing wildcards, in which case only those files will be
+listed.
+ Any file that is marked to be restored will have its name preceded by an
+ asterisk ({\bf *}). Directory names will be terminated with a forward slash
+ ({\bf /}) to distinguish them from filenames.
\item [lsmark]
\index[fd]{lsmark }
The {\bf lsmark} command is the same as the {\bf ls} except that it will
-print only those files marked for extraction. The other distinction is that
-it will recursively descend into any directory selected.
+ print only those files marked for extraction. The other distinction is that
+ it will recursively descend into any directory selected.
\item [mark]
\index[dir]{mark }
The {\bf mark} command allows you to mark files to be restored. It takes a
-single argument which is the filename or directory name in the current
-directory to be marked for extraction. The argument may be a wildcard
-specification, in which case all files that match in the current directory
-are marked to be restored. If the argument matches a directory rather than a
-file, then the directory and all the files contained in that directory
-(recursively) are marked to be restored. Any marked file will have its name
-preceded with an asterisk ({\bf *}) in the output produced by the {\bf ls} or
-{\bf dir} commands. Note, supplying a full path on the mark command does not
-work as expected to select a file or directory in the current directory.
-Also, the {\bf mark} command works on the current and lower directories but
-does not touch higher level directories.
-
-After executing the {\bf mark} command, it will print a brief summary:
+ single argument which is the filename or directory name in the current
+ directory to be marked for extraction. The argument may be a wildcard
+ specification, in which case all files that match in the current directory
+ are marked to be restored. If the argument matches a directory rather than a
+ file, then the directory and all the files contained in that directory
+ (recursively) are marked to be restored. Any marked file will have its name
+ preceded with an asterisk ({\bf *}) in the output produced by the {\bf ls}
+or
+ {\bf dir} commands. Note, supplying a full path on the mark command does not
+ work as expected to select a file or directory in the current directory.
+ Also, the {\bf mark} command works on the current and lower directories but
+ does not touch higher level directories.
+
+ After executing the {\bf mark} command, it will print a brief summary:
\footnotesize
\begin{verbatim}
\end{verbatim}
\normalsize
-If no files were marked, or:
+ If no files were marked, or:
\footnotesize
\begin{verbatim}
\end{verbatim}
\normalsize
-if some files are marked.
+ if some files are marked.
\item [unmark]
\index[dir]{unmark }
The {\bf unmark} is identical to the {\bf mark} command, except that it
-unmarks the specified file or files so that they will not be restored. Note:
-the {\bf unmark} command works from the current directory, so it does not
-unmark any files at a higher level. First do a {\bf cd /} before the {\bf
-unmark *} command if you want to unmark everything.
+ unmarks the specified file or files so that they will not be restored. Note:
+ the {\bf unmark} command works from the current directory, so it does not
+ unmark any files at a higher level. First do a {\bf cd /} before the {\bf
+ unmark *} command if you want to unmark everything.
\item [pwd]
\index[dir]{pwd }
The {\bf pwd} command prints the current working directory. It accepts no
-arguments.
+ arguments.
\item [count]
\index[dir]{count }
The {\bf count} command prints the total files in the directory tree and the
-number of files marked to be restored.
+ number of files marked to be restored.
\item [done]
\index[dir]{done }
\item [quit]
\index[fd]{quit }
- This command terminates the file selection and does not run the restore job.
+ This command terminates the file selection and does not run the restore
+job.
\item [help]
\item [?]
This command is the same as the {\bf help} command.
- \end{description}
+\end{description}
+
+\subsection*{Restoring When Things Go Wrong}
+\index[general]{Restoring When Things Go Wrong }
+\addcontentsline{toc}{subsection}{Restoring When Things Go Wrong}
+
+This and the following sections will try to present a few of the kinds of
+problems that can come up making restoring more difficult. I'll try to
+provide a few ideas how to get out of these problem situations.
+
+\begin{description}
+\item [Problem]
+ Your catalog has been damaged and Bacula either doesn't work or prints
+ errors.
+\item[Solution]
+ For SQLite, use the vacuum command to try to fix the database. For either
+ MySQL or PostgreSQL, see the vendor's documentation. They have specific tools
+ that check and repair databases.
+
+ Assuming the above does not resolve the problem, you will need to restore
+ or rebuild your catalog.
+\item[Problem]
+ How do I restore my catalog?
+\item[Solution]
+ If you have backed up your database nightly (as you should) and you
+ have made a bootstrap file, you can immediately load back your
+ database (or the ASCII SQL output). Make a copy of your current
+ database, then re-initialize it, by running the following scripts:
+\begin{verbatim}
+ ./drop_bacula_tables
+ ./make_bacula_tables
+\end{verbatim}
+ After re-initializing the database, you should be able to run
+ Bacula. If you now try to use the restore command, it will not
+ work because the database will be empty. However, you can manually
+ run a restore job and specify your bootstrap file. You do so
+ by entering the {bf run} command in the console and selecting the
+ restore job. If you are using the default bacula-dir.conf, this
+ Job will be named {\bf RestoreFiles}. Most likely it will prompt
+ you with something such as:
+\footnotesize
+\begin{verbatim}
+Run Restore job
+JobName: RestoreFiles
+Bootstrap: /home/kern/bacula/working/restore.bsr
+Where: /tmp/bacula-restores
+Replace: always
+FileSet: Full Set
+Client: rufus-fd
+Storage: File
+When: 2005-07-10 17:33:40
+Catalog: MyCatalog
+Priority: 10
+OK to run? (yes/mod/no):
+\end{verbatim}
+\normalsize
+ A number of the items will be different in your case. What you want
+ to do is: to use the mod option to change the Bootstrap to point to
+ your saved bootstrap file; and to make sure all the other items
+ such as Client, Storage, Catalog, and Where are correct. The
+ FileSet is not used when you specify a bootstrap file.
+ Once you have set all the correct values, run the Job and
+ it will restore the backup of your database. You will then
+ need to follow the instructions for your database type to
+ recreate the database from the ASCII backup file.
+
+
+\item[Solution]
+ If you did save your database but did not make a bootstrap file, then
+ recovering the database
+ is more difficult. You will probably need to use bextract to extract the
+ backup copy.
+ First you should locate the listing of the job report from the last catalog
+ backup. It has important information that will allow you to quickly find
+ your database file. For example, in the job report for the CatalogBackup
+ shown below, the critical items are the Volume name(s), the Volume Session Id
+ and the Volume Session Time. If you know those, you can easily restore your
+ Catalog.
+\footnotesize
+\begin{verbatim}
+
+22-Apr 10:22 HeadMan: Start Backup JobId 7510,
+Job=CatalogBackup.2005-04-22_01.10.0
+22-Apr 10:23 HeadMan: Bacula 1.37.14 (21Apr05): 22-Apr-2005 10:23:06
+ JobId: 7510
+ Job: CatalogBackup.2005-04-22_01.10.00
+ Backup Level: Full
+ Client: Polymatou
+ FileSet: "CatalogFile" 2003-04-10 01:24:01
+ Pool: "Default"
+ Storage: "DLTDrive"
+ Start time: 22-Apr-2005 10:21:00
+ End time: 22-Apr-2005 10:23:06
+ FD Files Written: 1
+ SD Files Written: 1
+ FD Bytes Written: 210,739,395
+ SD Bytes Written: 210,739,521
+ Rate: 1672.5 KB/s
+ Software Compression: None
+ Volume name(s): DLT-22Apr05
+ Volume Session Id: 11
+ Volume Session Time: 1114075126
+ Last Volume Bytes: 1,428,240,465
+ Non-fatal FD errors: 0
+ SD Errors: 0
+ FD termination status: OK
+ SD termination status: OK
+ Termination: Backup OK
+
+\end{verbatim}
+\normalsize
+ From the above information, you can manually create a bootstrap file,
+ and then follow the instructions given above for restoring your database.
+ A reconstructed bootstrap file for the above backup Job would look
+ like the following:
+\footnotesize
+\begin{verbatim}
+Volume="DLT-22Apr05"
+VolSessionId=11
+VolSessionTime=1114075126
+FileIndex=1-1
+\end{verbatim}
+\normalsize
+\end{description}
the Director's conf file (default {\bf no}).
{\bf SpoolData = yes|no}
+
\item To override the Job specification in a Schedule Run directive in the
Director's conf file.
{\bf SpoolData = yes|no}
+
\item To limit the maximum total size of the spooled data for a particular
device. Specified in the Device resource of the Storage daemon's conf file
(default unlimited).
{\bf Maximum Spool Size = size}
+ Where size is a the maximum spool size for all jobs specified in bytes.
-Where size is a the maximum spool size for all jobs specified in bytes.
\item To limit the maximum total size of the spooled data for a particular
device for a single job. Specified in the Device Resource of the Storage
daemon's conf file (default unlimited).
{\bf Maximum Job Spool Size = size}
+ Where size is the maximum spool file size for a single job specified in
+ bytes.
-Where size is the maximum spool file size for a single job specified in
-bytes.
\item To specify the spool directory for a particular device. Specified in
the Device Resource of the Storage daemon's conf file (default, the working
directory).
doesn't completely fill up. In principle, data spooling will properly detect a
full disk, and despool data allowing the job to continue. However, attribute
spooling is not so kind to the user. If the disk on which attributes are being
-spooled fills, the job will be canceled.
-\label{points}
+spooled fills, the job will be canceled. In addition, if your working
+directory is on the same partition as the spool directory, then Bacula jobs
+will fail possibly in bizarre ways when the spool fills.
+\label{points}
\subsection*{Other Points}
\index[general]{Points!Other }
\index[general]{Other Points }
\item When data spooling is enabled, Bacula automatically turns on attribute
spooling. In other words, it also spools the catalog entries to disk. This is
done so that in case the job fails, there will be no catalog entries
-pointing to non-existent tape backups.
+ pointing to non-existent tape backups.
\item Attribute despooling is done at the end of the job, as a consequence,
after Bacula stops writing the data to the tape, there may be a pause while
the attributes are sent to the Directory and entered into the catalog before
-the job terminates.
+ the job terminates.
\item Attribute spool files are always placed in the working directory.
\item When Bacula begins despooling data spooled to disk, it takes exclusive
use of the tape. This has the major advantage that in running multiple
simultaneous jobs at the same time, the blocks of several jobs will not be
-intermingled.
+ intermingled.
\item It probably does not make a lot of sense to enable data spooling if you
are writing to disk files.
\item It is probably best to provide as large a spool file as possible to
avoid repeatedly spooling/despooling. Also, while a job is despooling to
tape, the File daemon must wait (i.e. spooling stops for the job while it is
-despooling).
+ despooling).
\item If you are running multiple simultaneous jobs, Bacula will continue
spooling other jobs while one is despooling to tape, provided there is
sufficient spool file space.
\item Support for 64 bit machines, e.g. amd64.
\item Ability to encrypt communications between daemons using stunnel.
\item Support ANSI and IBM tape labels.
-\item Support for Unicode filenames (e.g. Chinese) on Win32 machines.
+\item Support for Unicode filenames (e.g. Chinese) on Win32 machines on
+ version 1.37.28 and greater.
\end{itemize}
and WinXP when they are in use by another program. Anyone knowing the magic
incantations, please step forward. The files that are skipped seem to be in
exclusive use by some other process, and don't appear to be too important.
+
+ Volume Shadow Copy (VSS) is now (July 2005) implemented in the Bacula Win32 File
+ daemon. The code is there, and it is being tested, but it is not yet
+ released.
+\item Path and filenames longer than 260 characters on Win32 systems are
+ not supported. They will be backed up, but they cannot be restored. By
+ using the {\bf Portable=yes} directive in your FileSet, files with
+ long names can be restored to Unix and Linux systems.
+
+ Long filenames for Win32 will be implemented in a later version.
\item If you have over 4 billion file entries stored in your database, the
database FileId is likely to overflow. This is a monster database, but still
possible. At some point, Bacula's FileId fields will be upgraded from 32 bits
to 64 bits and this problem will go away. In the mean time, a good workaround
is to use multiple databases.
\item Files deleted after a Full save will be included in a restoration.
-\item Event handlers are not yet implemented (e.g. when Job terminates do
- this, ...)
\item File System Modules (configurable routines for saving/restoring special
- files).
+ files) are not yet implemented.
\item Data encryption of the Volume contents.
\item Bacula cannot automatically restore files for a single Job
from two or more different storage devices or different media types.
That is, if you use more than one storage device or media type to
backup a single job, the restore process will require some manual
intervention.
-\item There is no concept of a Pool of backup devices (i.e. if device
- /dev/nst0 is busy, use /dev/nst1, ...).
- \end{itemize}
+\end{itemize}
\subsection*{Design Limitations or Restrictions}
\index[general]{Restrictions!Design Limitations or }
\index[sd]{Autochanger }
If {\bf Yes}, this device is an automatic tape changer, and you should also
specify a {\bf Changer Device} as well as a {\bf Changer Command}. If {\bf
- No} (default), the volume must be manually changed. You might also want to
- add an identical directive to the
+ No} (default), the volume must be manually changed. You should also
+ have an identical directive to the
\ilink{ Storage resource}{Autochanger1} in the Director's
configuration file so that when labeling tapes you are prompted for the slot.
#
# Default Bacula Storage Daemon Configuration file
#
-# For Bacula release 1.35.2 (16 August 2004) -- gentoo 1.4.16
+# For Bacula release 1.37.2 (07 July 2005) -- gentoo 1.4.16
#
# You may need to change the name of your tape drive
# on the "Archive Device" directive in the Device
# To connect, the Director's bacula-dir.conf must have the
# same Name and MediaType.
#
+Autochanger {
+ Name = Autochanger
+ Device = Drive-1
+ Device = Drive-2
+ Changer Command = "/home/kern/bacula/bin/mtx-changer %c %o %S %a %d"
+ Changer Device = /dev/sg0
+}
+
+Device {
+ Name = Drive-1 #
+ Drive Index = 0
+ Media Type = DLT-8000
+ Archive Device = /dev/nst0
+ AutomaticMount = yes; # when device opened, read it
+ AlwaysOpen = yes;
+ RemovableMedia = yes;
+ RandomAccess = no;
+ AutoChanger = yes
+ Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
+}
+
+Device {
+ Name = Drive-2 #
+ Drive Index = 1
+ Media Type = DLT-8000
+ Archive Device = /dev/nst1
+ AutomaticMount = yes; # when device opened, read it
+ AlwaysOpen = yes;
+ RemovableMedia = yes;
+ RandomAccess = no;
+ AutoChanger = yes
+ Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
+}
+
Device {
Name = "HP DLT 80"
Media Type = DLT8000
\multicolumn{1}{|c| }{\bf OS } & \multicolumn{1}{c| }{\bf Man. } &
\multicolumn{1}{c| }{\bf Media } & \multicolumn{1}{c| }{\bf Model } &
\multicolumn{1}{c| }{\bf Slots } & \multicolumn{1}{c| }{\bf Cap/Slot } \\
+ \hline {Linux } & {Adic } & {DDS-3} & {Adic 1200G } & {12} & {-} \\
\hline {Linux } & {Adic } & {LTO-1/2, SDLT 320 } & {Adic Scalar 24 } & {24} & {100GB } \\
\hline {Linux } & {Adic } & {LTO-2 } & {Adic FastStor 2, Sun Storedge L8 } & {8} & {200GB } \\
\hline {- } & {CA-VM } & {?? } & {Tape } & {??} & {?? } \\
- \hline {- } & {Dell } & {LTO-2 } & {PowerVault 132T/136T } & {-} & {100GB } \\
+ \hline {Linux Gentoo} & {Dell} & {DLT VI,LTO-2} & {PowerVault 122T/132T/136T } & {-} & {100GB } \\
\hline {- } & {DFSMS } & {?? } & {VM RMM} & {-} & {?? } \\
\hline {z/VM } & {IBM } & {?? } & {IBM Tape Manager } & {-} & {?? } \\
\hline {z/VM } & {IBM } & {?? } & {native tape } & {-} & {?? } \\
\index[general]{Aware!FreeBSD Users Be }
\addcontentsline{toc}{subsection}{FreeBSD Users Be Aware!!!}
-Unless you have patched the pthreads library on most FreeBSD systems, you will
+Unless you have patched the pthreads library on FreeBSD 4.11 systems, you will
lose data when Bacula spans tapes. This is because the unpatched pthreads
library fails to return a warning status to Bacula that the end of the tape is
-near. Please see the
+near. This problem is fixed in FreeBSD systems released after 4.11. Please see the
\ilink{Tape Testing Chapter}{FreeBSDTapes} of this manual for
{\bf important} information on how to configure your tape drive for
compatibility with Bacula.
For information on supported autochangers, please see the
\ilink{Autochangers Known to Work with Bacula}{Models}
section of the Supported Autochangers chapter of this manual.
+
+\subsection*{Tape Specifications}
+\index[general]{Specifications!Tape}
+\index[general]{Tape Specifications}
+\addcontentsline{toc}{subsection}{Tape Specifications}
+If you want to know what tape drive to buy that will work with Bacula,
+we really cannot tell you. However, we can say that if you are going
+to buy a drive, you should try to avoid DDS drives. The technology is
+rather old and DDS tape drives need frequent cleaning. DLT drives are
+generally much better (newer technology) and do not need frequent
+cleaning.
+
+Below, you will find a table of DLT and LTO tape specifications that will
+give you some idea of the capacity and speed of modern tapes. The
+capacities that are listed are the native tape capacity without compression.
+All modern drives have hardware compression, and manufacturers often list
+compressed capacity using a compression ration of 2:1. The actual compression
+ratio will depend mostly on the data you have to backup, but I find that
+1.5:1 is a much more reasonable number (i.e. multiply the value shown in
+the table by 1.5 to get a rough average of what you will probably see).
+The transfer rates are rounded to the nearest GB/hr. All values are provided
+by various manufacturers.
+
+The Media Type is what is designated by the manufacturers and you are not
+required to use (but you may) the same name in your Bacula conf resources.
+
+
+\begin{tabular}{|c|c|c|c}
+Media Type & Drive Type & Media Capacity & Transfer Rate \\ \hline
+DDS-1 & DAT & 2 GB & ?? GB/hr \\ \hline
+DDS-2 & DAT & 4 GB & ?? GB/hr \\ \hline
+DDS-3 & DAT & 12 GB & 5.4 GB/hr \\ \hline
+Travan 40 & Travan & 20 GB & ?? GB/hr \\ \hline
+DDS-4 & DAT & 20 GB & 11 GB/hr \\ \hline
+VXA-1 & Exabyte & 33 GB & 11 GB/hr \\ \hline
+DAT-72 & DAT & 36 GB & 13 GB/hr \\ \hline
+DLT IV & DLT8000 & 40 GB & 22 GB/hr \\ \hline
+VXA-2 & Exabyte & 80 GB & 22 GB/hr \\ \hline
+Half-high Ultrum 1 & LTO 1 & 100 GB & 27 GB/hr \\ \hline
+Ultrium 1 & LTO 1 & 100 GB & 54 GB/hr \\ \hline
+Super DLT 1 & SDLT 220 & 110 GB & 40 GB/hr \\ \hline
+VXA-3 & Exabyte & 160 GB & 43 GB/hr \\ \hline
+Super DLT I & SDLT 320 & 160 GB & 58 GB/hr \\ \hline
+Ultrium 2 & LTO 2 & 200 GB & 108 GB/hr \\ \hline
+Super DLT II & SDLT 600 & 300 GB & 127 GB/hr \\ \hline
+VXA-4 & Exabyte & 320 GB & 86 GB/hr \\ \hline
+Ultrium 3 & LTO 3 & 400 GB & 216 GB/hr \\ \hline
+\end{tabular}
+
for important considerations on how to specify Windows paths in Bacula FileSet
Include and Exclude directives.
+Bacula versions prior to 1.37.28 do not support Windows Unicode filenames.
+As of that version, both {\bf bconsole} and {\wx-console} support Windows
+Unicode filenames. There may still be some problems with multiple byte
+characters (e.g. Chinese, ...) where it is a two byte character but the
+displayed character is not two characters wide.
+
+Path/filenames longer than 260 characters are not supported. This may be
+possible in a future version.
+
\subsection*{Command Line Options Specific to the Bacula Windows File
Daemon (Client)}
\index[general]{Client!Command Line Options Specific to the Bacula Windows