From eeb8166812dfd92c3c8e60556a99dc45aeff1788 Mon Sep 17 00:00:00 2001 From: Philippe Chauvat Date: Fri, 12 Oct 2012 11:31:54 +0200 Subject: [PATCH] Developers, misc and problems manuals --- docs/covers/svg/coverpage-developers.svg | 14 +- docs/images/svg/git-edit-commit.svg | 454 ++++++++++++++++++ docs/manuals/en/console/Makefile.in | 21 +- docs/manuals/en/developers/Makefile.in | 7 +- docs/manuals/en/main/Makefile.in | 18 +- docs/manuals/en/misc/Makefile.in | 73 ++- docs/manuals/en/misc/dvd.tex | 106 ++-- docs/manuals/en/misc/internaldb.tex | 57 +-- docs/manuals/en/misc/misc.mst | 6 + docs/manuals/en/misc/misc.tex | 54 ++- docs/manuals/en/misc/python.tex | 121 +++-- docs/manuals/en/misc/stunnel.tex | 191 ++++---- docs/manuals/en/misc/table_sqlitevsmysql.tex | 51 ++ docs/manuals/en/misc/vars.tex | 103 ++-- docs/manuals/en/problems/Makefile.in | 72 ++- docs/manuals/en/problems/faq.tex | 296 ++++++------ docs/manuals/en/problems/firewalls.tex | 210 ++++---- docs/manuals/en/problems/kaboom.tex | 119 ++--- docs/manuals/en/problems/problems.tex | 76 ++- .../manuals/en/problems/problemsi-console.tex | 0 docs/manuals/en/problems/problemsi-dir.tex | 0 docs/manuals/en/problems/problemsi-fd.tex | 0 .../manuals/en/problems/problemsi-general.tex | 0 docs/manuals/en/problems/problemsi-sd.tex | 0 docs/manuals/en/problems/tapetesting.tex | 425 ++++++++-------- docs/manuals/en/problems/tips.tex | 403 ++++++++-------- docs/manuals/licences/coverpage.tex | 2 +- docs/manuals/licences/gpl.tex | 4 +- docs/manuals/licences/lesser.tex | 4 +- docs/manuals/licences/license.tex | 102 ++++ 30 files changed, 1776 insertions(+), 1213 deletions(-) create mode 100644 docs/images/svg/git-edit-commit.svg create mode 100644 docs/manuals/en/misc/misc.mst create mode 100644 docs/manuals/en/misc/table_sqlitevsmysql.tex create mode 100644 docs/manuals/en/problems/problemsi-console.tex create mode 100644 docs/manuals/en/problems/problemsi-dir.tex create mode 100644 docs/manuals/en/problems/problemsi-fd.tex create mode 100644 docs/manuals/en/problems/problemsi-general.tex create mode 100644 docs/manuals/en/problems/problemsi-sd.tex create mode 100644 docs/manuals/licences/license.tex diff --git a/docs/covers/svg/coverpage-developers.svg b/docs/covers/svg/coverpage-developers.svg index 0cd40844..3ed07e92 100644 --- a/docs/covers/svg/coverpage-developers.svg +++ b/docs/covers/svg/coverpage-developers.svg @@ -54,12 +54,12 @@ inkscape:cx="195.73943" inkscape:cy="392.82587" inkscape:document-units="px" - inkscape:current-layer="g3104" + inkscape:current-layer="g4863" showgrid="false" - inkscape:window-width="1920" - inkscape:window-height="1024" - inkscape:window-x="1366" - inkscape:window-y="27" + inkscape:window-width="1366" + inkscape:window-height="739" + inkscape:window-x="0" + inkscape:window-y="0" inkscape:window-maximized="1" showguides="true" inkscape:guide-bbox="true" @@ -111,7 +111,7 @@ image/svg+xml - + @@ -491,6 +491,6 @@ x="644.8819" sodipodi:role="line" style="font-size:40px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:expanded;text-align:end;line-height:125%;writing-mode:lr-tb;text-anchor:end;fill:#c10000;fill-opacity:1;font-family:Microgramma D;-inkscape-font-specification:Microgramma D Bold Expanded" - id="tspan4869">Developers Guide + id="tspan4869">Developer's Guide diff --git a/docs/images/svg/git-edit-commit.svg b/docs/images/svg/git-edit-commit.svg new file mode 100644 index 00000000..fb46a738 --- /dev/null +++ b/docs/images/svg/git-edit-commit.svg @@ -0,0 +1,454 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + git pull + + + + + Push A + Push B + HEAD + Your mods + + + + git pull + + + Push A + Push B + HEAD + Your mods + + + + + + + git pull + + + Push A + Push B + HEAD + Your mods + + + + + + diff --git a/docs/manuals/en/console/Makefile.in b/docs/manuals/en/console/Makefile.in index 12eb1e5b..2ef462e7 100644 --- a/docs/manuals/en/console/Makefile.in +++ b/docs/manuals/en/console/Makefile.in @@ -56,7 +56,7 @@ WEBCOMPILERFILE=$(MANUALSDIR)/bsys-web-mode.tex first_rule: all -all: pdflatex tex web mini-clean +all: tex pdflatex mini-clean .SUFFIXES: .tex .html .PHONY: @@ -93,16 +93,13 @@ epscovers: @echo "Done." commonfiles: + @../../update_version + @echo "Making version `cat version.tex`" @echo -n "Linking shared files..." @(for L in $(LICENCES); do ln -sf $$L .; done) @echo "Done" tex: epscovers epsimages commonfiles - @../../update_version - @echo "Making version `cat version.tex`" - @rm -rf $(IMAGES)/pdf - @rm -rf $(IMAGES)/png -# @cp -fp ${IMAGES}/hires/*.eps . @ln -sf $(TEXCOMPILERFILE) $(BSYSCOMPILERFILE) @touch ${DOC}i-dir.tex ${DOC}i-fd.tex ${DOC}i-sd.tex \ ${DOC}i-console.tex ${DOC}i-general.tex @@ -110,11 +107,6 @@ tex: epscovers epsimages commonfiles makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null latex -interaction=batchmode ${DOC}.tex -pdf: - @echo "Making pdfm" - @cp -fp ${IMAGES}/hires/*.eps . - dvipdfm -p a4 ${DOC}.dvi - pdflatex: pdfcovers pdfimages commonfiles @ln -sf $(PDFCOMPILERFILE) $(BSYSCOMPILERFILE) pdflatex -interaction=batchmode ${DOC}.tex @@ -122,11 +114,6 @@ pdflatex: pdfcovers pdfimages commonfiles pdflatex -interaction=batchmode ${DOC}.tex pdflatex -interaction=batchmode ${DOC}.tex -dvipdf: - @echo "Making dvi to pdf" - @cp -fp ${IMAGES}/hires/*.eps . - dvipdf ${DOC}.dvi ${DOC}.pdf - html: @echo " " @echo "Making html" @@ -161,6 +148,7 @@ web: fi) @cp -f ${DOC}/${MAINDOC} ${DOC}/index.html @echo "Done making web" + show: xdvi ${DOC} @@ -186,6 +174,7 @@ mini-clean: clean: + @find . -type l -name "*.tex" -exec rm {} \; @rm -f 1 2 3 *.tex~ @rm -f *.png *.gif *.jpg *.eps @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg diff --git a/docs/manuals/en/developers/Makefile.in b/docs/manuals/en/developers/Makefile.in index 2d822884..375f8bf9 100644 --- a/docs/manuals/en/developers/Makefile.in +++ b/docs/manuals/en/developers/Makefile.in @@ -54,7 +54,7 @@ WEBCOMPILERFILE=$(MANUALSDIR)/bsys-web-mode.tex first_rule: all -all: tex web pdf mini-clean +all: tex pdflatex mini-clean .SUFFIXES: .tex .html .PHONY: @@ -92,14 +92,14 @@ epscovers: @echo "Done." commonfiles: + @../../update_version + @echo -n "Making version `cat version.tex`" @echo -n "Linking shared files..." @(for L in $(LICENCES); do ln -sf $$L .; done) @echo "Done" tex: epscovers epsimages commonfiles - @../../update_version @ln -sf $(TEXCOMPILERFILE) $(BSYSCOMPILERFILE) -# @cp -fp ${IMAGES}/hires/*.eps . touch ${DOC}.idx ${DOC}i-general.tex -latex -interaction=batchmode ${DOC}.tex makeindex ${DOC}.idx >/dev/null 2>/dev/null @@ -178,6 +178,7 @@ mini-clean: @rm -f ${DOC}/WARNINGS clean: + @find . -type l -name "*.tex" -exec rm {} \; @rm -f 1 2 3 @rm -f *.png *.gif *.jpg *.eps @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg diff --git a/docs/manuals/en/main/Makefile.in b/docs/manuals/en/main/Makefile.in index 120e2e7e..de0a756b 100644 --- a/docs/manuals/en/main/Makefile.in +++ b/docs/manuals/en/main/Makefile.in @@ -52,7 +52,7 @@ TEXCOMPILERFILE=$(MANUALSDIR)/bsys-latex-mode.tex WEBCOMPILERFILE=$(MANUALSDIR)/bsys-web-mode.tex first_rule: all -all: tex web dvipdf mini-clean +all: tex pdflatex mini-clean .SUFFIXES: .tex .html .PHONY: @@ -90,14 +90,13 @@ epscovers: @echo "Done." commonfiles: + @../../update_version + @echo "Making version `cat version.tex`" @echo -n "Linking shared files..." @(for L in $(LICENCES); do ln -sf $$L .; done) @echo "Done" tex: epscovers epsimages - @../../update_version - @echo "Making version `cat version.tex`" -# @cp -fp ${IMAGES}/hires/*.eps . @ln -sf $(TEXCOMPILERFILE) $(BSYSCOMPILERFILE) @touch ${DOC}i-dir.tex ${DOC}i-fd.tex ${DOC}i-sd.tex \ ${DOC}i-console.tex ${DOC}i-general.tex @@ -109,11 +108,6 @@ tex: epscovers epsimages makeindex ${DOC}.cdx -o ${DOC}.cnd >/dev/null 2>/dev/null latex -interaction=batchmode ${DOC}.tex -pdf: - @echo "Making pdfm" - @cp -fp ${IMAGES}/hires/*.eps . - dvipdfm -p a4 ${DOC}.dvi - pdflatex: pdfcovers pdfimages commonfiles @ln -sf $(PDFCOMPILERFILE) $(BSYSCOMPILERFILE) pdflatex -interaction=batchmode ${DOC}.tex @@ -125,11 +119,6 @@ pdflatex: pdfcovers pdfimages commonfiles pdflatex -interaction=batchmode ${DOC}.tex pdflatex -interaction=batchmode ${DOC}.tex -dvipdf: - @echo "Making dvi to pdf" - @cp -fp ${IMAGES}/hires/*.eps . - dvipdf ${DOC}.dvi ${DOC}.pdf - html: @echo " " @echo "Making html" @@ -187,6 +176,7 @@ mini-clean: clean: + @find . -type l -name "*.tex" -exec rm {} \; @rm -f 1 2 3 *.tex~ @rm -f *.png *.gif *.jpg *.eps @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg diff --git a/docs/manuals/en/misc/Makefile.in b/docs/manuals/en/misc/Makefile.in index a70a83e4..cdb5167a 100644 --- a/docs/manuals/en/misc/Makefile.in +++ b/docs/manuals/en/misc/Makefile.in @@ -36,37 +36,85 @@ IMAGES=../../../images +MANUALSDIR=../.. DOC=misc MAINDOC=Bacula_Miscellaneous_Guide.html +BSYSMANUALDIR=../../../bsysmanual +COVERSDIR=../../../covers +PDFCOVERSDIR=$(COVERSDIR)/pdf +SVGCOVERSDIR=$(COVERSDIR)/svg +EPSCOVERSDIR=$(COVERSDIR)/eps +LICENSESDIR=$(MANUALSDIR)/licences +COVERNAME=coverpage-misc +BSYSMANNAME=bsysmanual-coverpagebackground +LICENCES=$(wildcard $(LICENSESDIR)/*.tex) +BSYSCOMPILERFILE=bsys-compiler-mode.tex +PDFCOMPILERFILE=$(MANUALSDIR)/bsys-pdflatex-mode.tex +TEXCOMPILERFILE=$(MANUALSDIR)/bsys-latex-mode.tex +WEBCOMPILERFILE=$(MANUALSDIR)/bsys-web-mode.tex + first_rule: all -all: tex web dvipdf mini-clean +all: tex pdflatex mini-clean .SUFFIXES: .tex .html .PHONY: .DONTCARE: -tex: +pdfcovers: + @echo -n "Linking coverpage and background PDF format..." + @(cd $(SVGCOVERSDIR) ; make pdf) + @ln -sf `pwd`/${PDFCOVERSDIR}/${COVERNAME}.pdf `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf + @echo "Done." + +pdfimages: + @echo "Generating PDF images..." + @(cd ${IMAGES}/svg ; make pdf) + @echo "Done." + +pngimages: + @echo "Generating PNG images..." + @(cd ${IMAGES}/svg ; make png) + @echo "Done." + +epsimages: + @echo "Generating EPS images..." + @(cd ${IMAGES}/svg ; make eps) + @rm -rf ${IMAGES}/png + @rm -rf ${IMAGES}/pdf + @echo "Done." + +epscovers: + @echo -n "Linking coverpage and background EPS format..." + @(cd $(SVGCOVERSDIR) ; make eps) + @ln -sf `pwd`/${EPSCOVERSDIR}/${COVERNAME}.eps `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.eps + @rm -f `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf + @echo "Done." + +commonfiles: @../../update_version - @echo "Making version `cat version.tex`" - @cp -fp ${IMAGES}/hires/*.eps . + @echo -n "Making version `cat version.tex`" + @echo -n "Linking shared files..." + @(for L in $(LICENCES); do ln -sf $$L .; done) + @echo "Done" + +tex: epscovers epsimages commonfiles + @ln -sf $(TEXCOMPILERFILE) $(BSYSCOMPILERFILE) @touch ${DOC}i-dir.tex ${DOC}i-fd.tex ${DOC}i-sd.tex \ ${DOC}i-console.tex ${DOC}i-general.tex latex -interaction=batchmode ${DOC}.tex makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null latex -interaction=batchmode ${DOC}.tex -pdf: - @echo "Making pdfm" - @cp -fp ${IMAGES}/hires/*.eps . - dvipdfm -p a4 ${DOC}.dvi -dvipdf: - @echo "Making dvi to pdf" - @cp -fp ${IMAGES}/hires/*.eps . - dvipdf ${DOC}.dvi ${DOC}.pdf +pdflatex: pdfcovers pdfimages commonfiles + @ln -sf $(PDFCOMPILERFILE) $(BSYSCOMPILERFILE) + pdflatex -interaction=batchmode ${DOC}.tex + makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null + pdflatex -interaction=batchmode ${DOC}.tex + pdflatex -interaction=batchmode ${DOC}.tex html: @echo " " @@ -123,6 +171,7 @@ mini-clean: clean: + @find . -type l -name "*.tex" -exec rm {} \; @rm -f 1 2 3 *.tex~ @rm -f *.png *.gif *.jpg *.eps @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg diff --git a/docs/manuals/en/misc/dvd.tex b/docs/manuals/en/misc/dvd.tex index c63ec14c..15cb603d 100644 --- a/docs/manuals/en/misc/dvd.tex +++ b/docs/manuals/en/misc/dvd.tex @@ -24,7 +24,7 @@ using any standard DVD burning program. Bacula allows you to specify that you want to write to DVD. However, this feature is implemented only in version 1.37 or later. -You may in fact write to DVD+RW, DVD+R, DVD-R, or DVD-RW +You may in fact write to DVD+RW, DVD+R, DVD-R, or DVD-RW media. The actual process used by Bacula is to first write the image to a spool directory, then when the Volume reaches a certain size or, at your option, at the end of a Job, Bacula @@ -39,7 +39,7 @@ work. Please note that the original {\bf dvd+rw-tools} package does {\bf NOT} work with Bacula. You must apply a patch which can be found in the {\bf patches} directory of Bacula sources with the name {\bf dvd+rw-tools-5.21.4.10.8.bacula.patch} for version 5.21 of the tools, -or patch {bf dvd+rw-tools-6.1.bacula.patch} if you have version 6.1 +or patch {bf dvd+rw-tools-6.1.bacula.patch} if you have version 6.1 on your system. Unfortunately, this requires you to build the dvd\_rw-tools from source. @@ -58,7 +58,7 @@ The remainder of this chapter explains the various directives that you can use to control the DVD writing. \label{DVDdirectives} -\section{DVD Specific SD Directives} +\section{DVD Specific SD Directives} \index[general]{Directives!DVD} \index[general]{DVD Specific SD Directives } @@ -78,31 +78,31 @@ Device resource. \item [Mount Point = {\it directory}] \index[general]{Mount Point} - Directory where the device can be mounted. + Directory where the device can be mounted. \item [Mount Command = {\it name-string}] \index[general]{Mount Command} Command that must be executed to mount the device. Although the device is written directly, the mount command is necessary in - order to determine the free space left on the DVD. Before the command is - executed, \%a is replaced with the Archive Device, and \%m with the Mount + order to determine the free space left on the DVD. Before the command is + executed, \%a is replaced with the Archive Device, and \%m with the Mount Point. - Most frequently, you will define it as follows: + Most frequently, you will define it as follows: \footnotesize -\begin{verbatim} +\begin{lstlisting} Mount Command = "/bin/mount -t iso9660 -o ro %a %m" -\end{verbatim} +\end{lstlisting} \normalsize However, if you have defined a mount point in /etc/fstab, you might be able to use a mount command such as: \footnotesize -\begin{verbatim} +\begin{lstlisting} Mount Command = "/bin/mount /media/dvd" -\end{verbatim} +\end{lstlisting} \normalsize @@ -112,32 +112,32 @@ able to use a mount command such as: executed, \%a is replaced with the Archive Device, and \%m with the Mount Point. - Most frequently, you will define it as follows: + Most frequently, you will define it as follows: \footnotesize -\begin{verbatim} +\begin{lstlisting} Unmount Command = "/bin/umount %m" -\end{verbatim} +\end{lstlisting} \normalsize \item [Write Part Command = {\it name-string}] \index[general]{Write Part Command } - Command that must be executed to write a part to the device. Before the - command is executed, \%a is replaced with the Archive Device, \%m with the + Command that must be executed to write a part to the device. Before the + command is executed, \%a is replaced with the Archive Device, \%m with the Mount Point, \%e is replaced with 1 if we are writing the first part, and with 0 otherwise, and \%v with the current part filename. For a DVD, you will most frequently specify the Bacula supplied {\bf - dvd-handler} script as follows: + dvd-handler} script as follows: \footnotesize -\begin{verbatim} +\begin{lstlisting} Write Part Command = "/path/dvd-handler %a write %e %v" -\end{verbatim} +\end{lstlisting} \normalsize Where {\bf /path} is the path to your scripts install directory, and - dvd-handler is the Bacula supplied script file. + dvd-handler is the Bacula supplied script file. This command will already be present, but commented out, in the default bacula-sd.conf file. To use it, simply remove the comment (\#) symbol. @@ -145,17 +145,17 @@ able to use a mount command such as: \item [Free Space Command = {\it name-string}] \index[general]{Free Space Command } - Command that must be executed to check how much free space is left on the + Command that must be executed to check how much free space is left on the device. Before the command is executed,\%a is replaced with the Archive Device. For a DVD, you will most frequently specify the Bacula supplied {\bf - dvd-handler} script as follows: + dvd-handler} script as follows: \footnotesize -\begin{verbatim} +\begin{lstlisting} Free Space Command = "/path/dvd-handler %a free" -\end{verbatim} +\end{lstlisting} \normalsize Where {\bf /path} is the path to your scripts install directory, and @@ -167,14 +167,14 @@ able to use a mount command such as: the comment (\#) symbol. If you do not set it, Bacula will expect there is always free space on the - device. + device. \end{description} In addition to the directives specified above, you must also specify the other standard Device resource directives. Please see the sample DVD Device resource in the default bacula-sd.conf file. Be sure -to specify the raw device name for {\bf Archive Device}. It should +to specify the raw device name for {\bf Archive Device}. It should be a name such as {\bf /dev/cdrom} or {\bf /media/cdrecorder} or {\bf /dev/dvd} depending on your system. It will not be a name such as {\bf /mnt/cdrom}. @@ -184,40 +184,40 @@ a certain amount of memory in RAM. If you have restrictions on this function, you may have failures. Under {\bf bash}, you can set this with the following command: -\footnotesize -\begin{verbatim} +\footnotesize +\begin{lstlisting} ulimit -l unlimited -\end{verbatim} +\end{lstlisting} \normalsize -\section{Edit Codes for DVD Directives} +\section{Edit Codes for DVD Directives} \index[general]{Directives!DVD Edit Codes} \index[general]{Edit Codes for DVD Directives } -Before submitting the {\bf Mount Command}, {\bf Unmount Command}, -{\bf Write Part Command}, or {\bf Free Space Command} directives +Before submitting the {\bf Mount Command}, {\bf Unmount Command}, +{\bf Write Part Command}, or {\bf Free Space Command} directives to the operating system, Bacula performs character substitution of the following characters: \footnotesize -\begin{verbatim} +\begin{lstlisting} %% = % %a = Archive device name %e = erase (set if cannot mount and first part) %n = part number %m = mount point %v = last part name (i.e. filename) -\end{verbatim} +\end{lstlisting} \normalsize -\section{DVD Specific Director Directives} +\section{DVD Specific Director Directives} \index[general]{Directives!DVD} \index[general]{DVD Specific Director Directives } The following directives are added to the Director's Job resource. - + \label{WritePartAfterJob} \begin{description} \item [Write Part After Job = \lt{}yes|no\gt{}] @@ -225,7 +225,7 @@ The following directives are added to the Director's Job resource. If this directive is set to {\bf yes} (default {\bf no}), the Volume written to a temporary spool file for the current Job will be written to the DVD as a new part file - will be created after the job is finished. + will be created after the job is finished. It should be set to {\bf yes} when writing to devices that require a mount (for example DVD), so you are sure that the current part, containing @@ -271,7 +271,7 @@ The following directives are added to the Director's Job resource. add up quickly, so it is best to mount your DVD+RW filesystem read-only. Bacula does not need the DVD to be mounted read-write, since it uses the raw device for writing. -\item Reformatting DVD+RW 10-20 times can apparently make the medium +\item Reformatting DVD+RW 10-20 times can apparently make the medium unusable. Normally you should not have to format or reformat DVD+RW media. If it is necessary, current versions of growisofs will do so automatically. @@ -280,52 +280,52 @@ The following directives are added to the Director's Job resource. Incremental Sequential} and {\bf Restricted Overwrite}. Depending on your device and the media you use, one of these modes may not work correctly (e.g. {\bf Incremental Sequential} does not work with my NEC - DVD-writer and Verbatim DVD-RW). + DVD-writer and Lstlisting DVD-RW). To retrieve the current mode of a DVD-RW, run: -\begin{verbatim} +\begin{lstlisting} dvd+rw-mediainfo /dev/xxx -\end{verbatim} +\end{lstlisting} where you replace xxx with your DVD device name. {\bf Mounted Media} line should give you the information. To set the device to {\bf Restricted Overwrite} mode, run: -\begin{verbatim} +\begin{lstlisting} dvd+rw-format /dev/xxx -\end{verbatim} +\end{lstlisting} If you want to set it back to the default {\bf Incremental Sequential} mode, run: -\begin{verbatim} +\begin{lstlisting} dvd+rw-format -blank /dev/xxx -\end{verbatim} +\end{lstlisting} \item Bacula only accepts to write to blank DVDs. To quickly blank a DVD+/-RW, run this command: -\begin{verbatim} +\begin{lstlisting} dd if=/dev/zero bs=1024 count=512 | growisofs -Z /dev/xxx=/dev/fd/0 -\end{verbatim} +\end{lstlisting} Then, try to mount the device, if it cannot be mounted, it will be considered as blank by Bacula, if it can be mounted, try a full blank (see below). \item If you wish to blank completely a DVD+/-RW, use the following: -\begin{verbatim} +\begin{lstlisting} growisofs -Z /dev/xxx=/dev/zero -\end{verbatim} +\end{lstlisting} where you replace xxx with your DVD device name. However, note that this blanks the whole DVD, which takes quite a long time (16 minutes on mine). \item DVD+RW and DVD-RW support only about 1000 overwrites (i.e. don't use the same medium for years if you don't want to have problems...). To write to the DVD the first time use: -\begin{verbatim} +\begin{lstlisting} growisofs -Z /dev/xxx filename -\end{verbatim} +\end{lstlisting} To add additional files (more parts use): -\begin{verbatim} +\begin{lstlisting} growisofs -M /dev/xxx filename -\end{verbatim} +\end{lstlisting} The option {\bf -use-the-force-luke=4gms} was added in growisofs 5.20 to override growisofs' behavior of always checking for the 4GB limit. diff --git a/docs/manuals/en/misc/internaldb.tex b/docs/manuals/en/misc/internaldb.tex index 65cd0ea0..fc219679 100644 --- a/docs/manuals/en/misc/internaldb.tex +++ b/docs/manuals/en/misc/internaldb.tex @@ -1,6 +1,3 @@ -%% -%% - \chapter{The internal database is not supported, please do not use it.} \label{InternalDbChapter} @@ -9,68 +6,28 @@ do not } \index[general]{The internal database is not supported, please do not use it. } -\section{Internal Bacula Database} +\section{Internal Bacula Database}\label{chap:InternalBaculaDatabase} \index[general]{Internal Bacula Database } \index[general]{Database!Internal Bacula } Previously it was intended to be used primarily by Bacula developers for testing; although SQLite is also a good choice for this. We do not recommend -its use in general. +its use in general. This database is simplistic in that it consists entirely of Bacula's internal structures appended sequentially to a file. Consequently, it is in most cases inappropriate for sites with many clients or systems with large numbers of -files, or long-term production environments. +files, or long-term production environments. Below, you will find a table comparing the features available with SQLite and MySQL and with the internal Bacula database. At the current time, you cannot dynamically switch from one to the other, but must rebuild the Bacula source code. If you wish to experiment with both, it is possible to build both -versions of Bacula and install them into separate directories. - -\addcontentsline{lot}{table}{SQLite vs MySQL Database Comparison} -\begin{longtable}{|l|l|l|} - \hline -\multicolumn{1}{|c| }{\bf Feature } & \multicolumn{1}{c| }{\bf SQLite or MySQL - } & \multicolumn{1}{c| }{\bf Bacula } \\ - \hline -{Job Record } & {Yes } & {Yes } \\ - \hline -{Media Record } & {Yes } & {Yes } \\ - \hline -{FileName Record } & {Yes } & {No } \\ - \hline -{File Record } & {Yes } & {No } \\ - \hline -{FileSet Record } & {Yes } & {Yes } \\ - \hline -{Pool Record } & {Yes } & {Yes } \\ - \hline -{Client Record } & {Yes } & {Yes } \\ - \hline -{JobMedia Record } & {Yes } & {Yes } \\ - \hline -{List Job Records } & {Yes } & {Yes } \\ - \hline -{List Media Records } & {Yes } & {Yes } \\ - \hline -{List Pool Records } & {Yes } & {Yes } \\ - \hline -{List JobMedia Records } & {Yes } & {Yes } \\ - \hline -{Delete Pool Record } & {Yes } & {Yes } \\ - \hline -{Delete Media Record } & {Yes } & {Yes } \\ - \hline -{Update Pool Record } & {Yes } & {Yes } \\ - \hline -{Implement Verify } & {Yes } & {No } \\ - \hline -{MD5 Signatures } & {Yes } & {No } -\\ \hline +versions of Bacula and install them into separate directories. -\end{longtable} +%\addcontentsline{lot}{table}{SQLite vs MySQL Database Comparison} +\LTXtable{0.95\linewidth}{table_sqlitevsmysql} In addition, since there is no SQL available, the Console commands: {\bf sqlquery}, {\bf query}, {\bf retention}, and any other command that directly -uses SQL are not available with the Internal database. +uses SQL are not available with the Internal database. diff --git a/docs/manuals/en/misc/misc.mst b/docs/manuals/en/misc/misc.mst new file mode 100644 index 00000000..a64fd5dd --- /dev/null +++ b/docs/manuals/en/misc/misc.mst @@ -0,0 +1,6 @@ +delim_0 +", \\dotfill{}" +delim_1 +", \\dotfill{}" +delim_2 +", \\dotfill{}" diff --git a/docs/manuals/en/misc/misc.tex b/docs/manuals/en/misc/misc.tex index 59351e52..3d3b02b7 100644 --- a/docs/manuals/en/misc/misc.tex +++ b/docs/manuals/en/misc/misc.tex @@ -5,17 +5,30 @@ %% %% # $ % & ~ _ ^ \ { } %% +\documentclass[10pt,bsyspaper,english,logo,titlepage]{bsysmanual} -\documentclass[10pt,a4paper]{book} +\renewcommand{\familydefault}{\sfdefault} +\usepackage[utf8]{inputenc} +\usepackage[toc,title,header,page]{appendix} +\usepackage[T1]{fontenc} +\usepackage{longtable,graphicx,fancyhdr,lastpage,eurosym,dcolumn,ltxtable} +\usepackage{textcomp,varioref,lscape,pdfpages,ifthen,setspace,colortbl,diagbox} +\usepackage{lmodern,minitoc} +\usepackage{MnSymbol} +\usepackage{bbding,multirow} +\usepackage[hyphens]{url} +\usepackage[plainpages=true,bookmarks=false,bookmarksopen=false,filecolor=black,linkcolor=black,urlcolor=bsysredtwo,filebordercolor={0. 0. 0.},menubordercolor={0. 0. 0.},urlbordercolor={0. 0. 0.},linkbordercolor={0. 0. 0.},hyperindex=false,colorlinks=true]{hyperref} +\usepackage{babel,xr,xr-hyper} +\usepackage[font={sf,bf},textfont=md]{caption} +\usepackage[printonlyused]{acronym} +\setlength\arrayrulewidth{0.4pt} +\include{bsyscommondefs} +\usepackage[left=4cm,right=3cm,bottom=2cm,top=2.5cm]{geometry} +\usepackage{moreverb,fancyvrb} +\usepackage{listings} +\input{external-references} +\pdfminorversion=4 -\topmargin -0.5in -\oddsidemargin 0.0in -\evensidemargin 0.0in -\textheight 10in -\textwidth 6.5in - - -\usepackage{html} \usepackage{float} \usepackage{graphicx} \usepackage{bacula} @@ -23,42 +36,41 @@ \usepackage{makeidx} \usepackage{index} \usepackage{setspace} -\usepackage{hyperref} -% \usepackage[linkcolor=black,colorlinks=true]{hyperref} \usepackage{url} + \makeindex \newindex{general}{idx}{ind}{General Index} \sloppy +\def\bsystitle{Bacula Miscellaneous Guide} \begin{document} \sloppy - +\lstset{escapechar=,breaklines=true,basicstyle=\ttfamily\scriptsize,backgroundcolor=\color{lightbsysgrey}} \include{coverpage} - -\clearpage -\pagenumbering{roman} +\frontmatter \tableofcontents -\clearpage +\listoftables +%\listoffigures -\pagestyle{myheadings} -\markboth{Bacula Version \version}{Bacula Version \version} -\pagenumbering{arabic} +\mainmatter \include{python} \include{vars} \include{stunnel} \include{dvd} \include{projects} \include{internaldb} +\begin{appendices} +\begin{small} \include{license} \include{fdl} \include{gpl} \include{lesser} - +\end{small} +\end{appendices} % pull in the index -\clearpage \printindex[general] \end{document} diff --git a/docs/manuals/en/misc/python.tex b/docs/manuals/en/misc/python.tex index 5d3c9530..d675fba2 100644 --- a/docs/manuals/en/misc/python.tex +++ b/docs/manuals/en/misc/python.tex @@ -1,6 +1,3 @@ -%% -%% - \chapter{Python Scripting} \label{PythonChapter} \index[general]{Python Scripting} @@ -11,9 +8,9 @@ needed in Bacula. The answer to the first question is that Python is an Object Oriented scripting language with features similar to those found in Perl, but the syntax of the language is much cleaner and simpler. The answer to why have scripting in Bacula is to -give the user more control over the whole backup process. Probably +give the user more control over the whole backup process. Probably the simplest example is when Bacula needs a new Volume name, with -a scripting language such as Python, you can generate any name +a scripting language such as Python, you can generate any name you want, based on the current state of Bacula. \section{Python Configuration} @@ -27,7 +24,7 @@ location. If you are using RPMs you will need the python-devel package installed. When Python is configured, it becomes an integral part of Bacula and -runs in Bacula's address space, so even though it is an interpreted +runs in Bacula's address space, so even though it is an interpreted language, it is very efficient. When the Director starts, it looks to see if you have a {\bf @@ -42,10 +39,10 @@ scripts are for you to program. This means that with a default installation with Python enabled, Bacula will print the following error message: -\begin{verbatim} +\begin{lstlisting} 09-Jun 15:14 bacula-dir: ERROR in pythonlib.c:131 Could not import Python script /etc/bacula/scripts/DirStartUp. Python disabled. -\end{verbatim} +\end{lstlisting} The source code directory {\bf examples/python} contains sample scripts for DirStartUp.py, SDStartUp.py, and FDStartUp.py that you might want @@ -63,14 +60,14 @@ existing code with a {\bf noop = 1}. \index[general]{Bacula Events} \index[general]{Events} A Bacula event is a point in the Bacula code where Bacula -will call a subroutine (actually a method) that you have -defined in the Python StartUp script. Events correspond +will call a subroutine (actually a method) that you have +defined in the Python StartUp script. Events correspond to some significant event such as a Job Start, a Job End, Bacula needs a new Volume Name, ... When your script is called, it will have access to all the Bacula variables specific to the Job (attributes of the Job Object), and it can even call some of the Job methods (subroutines) -or set new values in the Job attributes, such as the +or set new values in the Job attributes, such as the Priority. You will see below how the events are used. \section{Python Objects} @@ -84,17 +81,17 @@ There are four Python objects that you will need to work with: in the present case) when the daemon starts. It is available to the Python startup script, {\bf DirStartup.py}, by importing the Bacula definitions with {\bf import bacula}. The methods - available with this object are described below. + available with this object are described below. \item [The Bacula Events Class] You create this class in the startup script, and you pass - it to the Bacula Object's {\bf set\_events} method. The + it to the Bacula Object's {\bf set\_events} method. The purpose of the Bacula Events Class is to define what global or daemon events you want to monitor. When one of those events occurs, your Bacula Events Class will be called at the method corresponding to the event. There are currently three events, JobStart, JobEnd, and Exit, which are described in detail below. - + \item [The Job Object] When a Job starts, and assuming you have defined a JobStart method in your Bacula Events Class, Bacula will create a Job Object. This @@ -103,7 +100,7 @@ There are four Python objects that you will need to work with: details of the Job, and it also has a number of writable attributes that allow you to pass information into the Job. These attributes are described below. - + \item [The Job Events Class] You create this class in the JobStart method of your Bacula Events class, and it allows you to define which of the possible Job Object @@ -117,8 +114,8 @@ There are four Python objects that you will need to work with: The first thing the startup script must do is to define what global Bacula -events (daemon events), it wants to see. This is done by creating a -Bacula Events class, instantiating it, then passing it to the +events (daemon events), it wants to see. This is done by creating a +Bacula Events class, instantiating it, then passing it to the {\bf set\_events} method. There are three possible events. @@ -135,7 +132,7 @@ events. \item [JobEnd] This Python method, if defined, will be called each time a Job terminates. The method is passed the class instantiation object as the first argument, - and the Bacula Job object as the second argument. + and the Bacula Job object as the second argument. \item [Exit] This Python method, if defined, will be called when the Director terminates. @@ -157,23 +154,19 @@ The following are the read-only attributes provided by the bacula object. A simple definition of the Bacula Events Class might be the following: -\footnotesize -\begin{verbatim} +\begin{lstlisting} import sys, bacula class BaculaEvents: def JobStart(self, job): ... -\end{verbatim} -\normalsize +\end{lstlisting} Then to instantiate the class and pass it to Bacula, you would do: -\footnotesize -\begin{verbatim} +\begin{lstlisting} bacula.set_events(BaculaEvents()) # register Bacula Events wanted -\end{verbatim} -\normalsize +\end{lstlisting} And at that point, each time a Job is started, your BaculaEvents JobStart method will be called. @@ -185,38 +178,34 @@ Job Events that Bacula will generate. A simple Job Events class might look like the following: -\footnotesize -\begin{verbatim} +\begin{lstlisting} class JobEvents: def NewVolume(self, job): ... -\end{verbatim} -\normalsize +\end{lstlisting} Here, your JobEvents class method NewVolume will be called each time the Job needs a new Volume name. To actually register the events defined in your class with the Job, you must instantiate the JobEvents class and -set it in the Job {\bf set\_events} variable. Note, this is a bit different +set it in the Job {\bf set\_events} variable. Note, this is a bit different from how you registered the Bacula events. The registration process must -be done in the Bacula JobStart event (your method). So, you would modify +be done in the Bacula JobStart event (your method). So, you would modify Bacula Events (not the Job events) as follows: -\footnotesize -\begin{verbatim} +\begin{lstlisting} import sys, bacula class BaculaEvents: def JobStart(self, job): events = JobEvents() # create instance of Job class job.set_events(events) # register Job events desired ... -\end{verbatim} -\normalsize +\end{lstlisting} When a job event is triggered, the appropriate event definition is called in the JobEvents class. This is the means by which your Python script or code gets control. Once it has control, it may read job attributes, or set them. See below for a list of read-only attributes, -and those that are writable. +and those that are writable. In addition, the Bacula {\bf job} object in the Director has a number of methods (subroutines) that can be called. They @@ -238,19 +227,19 @@ are: \item[cancel] The cancel method takes a single integer argument, which is a JobId. If JobId is found, it will be canceled. \item [DoesVolumeExist] The DoesVolumeExist method takes a single - string argument, which is the Volume name, and returns + string argument, which is the Volume name, and returns 1 if the volume exists in the Catalog and 0 if the volume does not exist. \end{description} -The following attributes are read/write within the Director +The following attributes are read/write within the Director for the {\bf job} object. \begin{description} \item [Priority] Read or set the Job priority. Note, that setting a Job Priority is effective only before the Job actually starts. -\item [Level] This attribute contains a string representing the Job +\item [Level] This attribute contains a string representing the Job level, e.g. Full, Differential, Incremental, ... if read. The level can also be set. \end{description} @@ -308,7 +297,7 @@ for the {\bf job} object. \item [Priority] This attribute contains an integer with the priority assigned to the job. \item [CatalogRes] tuple consisting of (DBName, Address, User, - Password, Socket, Port, Database Vendor) taken from the Catalog resource + Password, Socket, Port, Database Vendor) taken from the Catalog resource for the Job with the exception of Database Vendor, which is one of the following: MySQL, PostgreSQL, SQLite, Internal, depending on what database you configured. @@ -332,9 +321,9 @@ Director: There is a new Console command named {\bf python}. It takes a single argument {\bf restart}. Example: -\begin{verbatim} +\begin{lstlisting} python restart -\end{verbatim} +\end{lstlisting} This command restarts the Python interpreter in the Director. This can be useful when you are modifying the DirStartUp script, @@ -344,43 +333,43 @@ script will be read one time. \section{Debugging Python Scripts} \index[general]{Debugging Python Scripts} In general, you debug your Python scripts by using print statements. -You can also develop your script or important parts of it as a +You can also develop your script or important parts of it as a separate file using the Python interpreter to run it. Once you -have it working correctly, you can then call the script from +have it working correctly, you can then call the script from within the Bacula Python script (DirStartUp.py). If you are having problems loading DirStartUp.py, you will probably -not get any error messages because Bacula can only print Python +not get any error messages because Bacula can only print Python error messages after the Python interpreter is started. However, you may be able to see the error messages by starting Bacula in a shell window with the {\bf -d1} option on the command line. That should cause the Python error messages to be printed in the shell window. -If you are getting error messages such as the following when +If you are getting error messages such as the following when loading DirStartUp.py: -\begin{verbatim} +\begin{lstlisting} Traceback (most recent call last): File "/etc/bacula/scripts/DirStartUp.py", line 6, in ? import time, sys, bacula ImportError: /usr/lib/python2.3/lib-dynload/timemodule.so: undefined symbol: PyInt_FromLong bacula-dir: pythonlib.c:134 Python Import error. -\end{verbatim} - +\end{lstlisting} + It is because the DirStartUp script is calling a dynamically loaded module (timemodule.so in the above case) that then tries to use Python functions exported from the Python interpreter (in this case PyInt\_FromLong). The way Bacula is currently linked with Python does -not permit this. The solution to the problem is to put such functions +not permit this. The solution to the problem is to put such functions (in this case the import of time into a separate Python script, which will do your calculations and return the values you want. Then call (not import) this script from the Bacula DirStartUp.py script, and it all should work as you expect. - - - + + + \section{Python Example} @@ -390,8 +379,7 @@ it all should work as you expect. An example script for the Director startup file is provided in {\bf examples/python/DirStartup.py} as follows: -\footnotesize -\begin{verbatim} +\begin{lstlisting} # # Bacula Python interface script for the Director # @@ -404,7 +392,7 @@ import sys, bacula class BaculaEvents(object): def __init__(self): # Called here when a new Bacula Events class is - # is created. Normally not used + # is created. Normally not used noop = 1 def JobStart(self, job): @@ -419,19 +407,19 @@ class BaculaEvents(object): sys.stderr = events # send error output to Bacula sys.stdout = events # send stdout to Bacula jobid = job.JobId; client = job.Client - numvols = job.NumVols - job.JobReport="Python Dir JobStart: JobId=%d Client=%s NumVols=%d\n" % (jobid,client,numvols) + numvols = job.NumVols + job.JobReport="Python Dir JobStart: JobId=%d Client=%s NumVols=%d\n" % (jobid,client,numvols) # Bacula Job is going to terminate - def JobEnd(self, job): + def JobEnd(self, job): jobid = job.JobId - client = job.Client - job.JobReport="Python Dir JobEnd output: JobId=%d Client=%s.\n" % (jobid, client) + client = job.Client + job.JobReport="Python Dir JobEnd output: JobId=%d Client=%s.\n" % (jobid, client) # Called here when the Bacula daemon is going to exit def Exit(self, job): print "Daemon exiting." - + bacula.set_events(BaculaEvents()) # register daemon events desired """ @@ -442,11 +430,11 @@ class JobEvents(object): # Called here when you instantiate the Job. Not # normally used noop = 1 - + def JobInit(self, job): # Called when the job is first scheduled noop = 1 - + def JobRun(self, job): # Called just before running the job after initializing # This is the point to change most Job parameters. @@ -475,5 +463,4 @@ class JobEvents(object): -\end{verbatim} -\normalsize +\end{lstlisting} diff --git a/docs/manuals/en/misc/stunnel.tex b/docs/manuals/en/misc/stunnel.tex index 49078651..c44ed1fd 100644 --- a/docs/manuals/en/misc/stunnel.tex +++ b/docs/manuals/en/misc/stunnel.tex @@ -1,12 +1,9 @@ -%% -%% - \chapter{Using Stunnel to Encrypt Communications} \label{StunnelChapter} \index[general]{Using Stunnel to Encrypt Communications to Clients } Prior to version 1.37, Bacula did not have built-in communications encryption. -Please see the \ilink {TLS chapter}{CommEncryption} if you are using Bacula +Please see the \ilink{TLS chapter}{CommEncryption} if you are using Bacula 1.37 or greater. Without too much effort, it is possible to encrypt the communications @@ -17,7 +14,7 @@ Director and the Storage daemon are running on one machine that will be called called {\bf client}. Although the details may be slightly different, the same principles apply whether you are encrypting between Unix, Linux, or Win32 machines. This example was developed between two Linux machines running -stunnel version 4.04-4 on a Red Hat Enterprise 3.0 system. +stunnel version 4.04-4 on a Red Hat Enterprise 3.0 system. \section{Communications Ports Used} \index[general]{Used!Communications Ports } @@ -37,27 +34,27 @@ daemon. The encryption is accomplished between the Director and the File daemon by using an stunnel on the Director's machine (server) to encrypt the data and to contact an stunnel on the File daemon's machine (client), which decrypts the -data and passes it to the client. +data and passes it to the client. Between the File daemon and the Storage daemon, we use an stunnel on the File daemon's machine to encrypt the data and another stunnel on the Storage -daemon's machine to decrypt the data. +daemon's machine to decrypt the data. As a consequence, there are actually four copies of stunnel running, two on the server and two on the client. This may sound a bit complicated, but it really isn't. To accomplish this, we will need to construct four separate conf files for stunnel, and we will need to make some minor modifications to the -Director's conf file. None of the other conf files need to be changed. +Director's conf file. None of the other conf files need to be changed. \section{A Picture} \index[general]{Picture } Since pictures usually help a lot, here is an overview of what we will be doing. Don't worry about all the details of the port numbers and such for the -moment. +moment. \footnotesize -\begin{verbatim} +\begin{lstlisting} File daemon (client): stunnel-fd1.conf |===========| @@ -76,7 +73,7 @@ moment. |===========| Port 29103 >----| Stunnel 4 |-----> 9103 |===========| -\end{verbatim} +\end{lstlisting} \normalsize \section{Certificates} @@ -86,18 +83,18 @@ In order for stunnel to function as a server, which it does in our diagram for Stunnel 1 and Stunnel 4, you must have a certificate and the key. It is possible to keep the two in separate files, but normally, you keep them in one single .pem file. You may create this certificate yourself in which case, it -will be self-signed, or you may have it signed by a CA. +will be self-signed, or you may have it signed by a CA. If you want your clients to verify that the server is in fact valid (Stunnel 2 and Stunnel 3), you will need to have the server certificates signed by a CA (Certificate Authority), and you will need to have the CA's public certificate -(contains the CA's public key). +(contains the CA's public key). Having a CA signed certificate is {\bf highly} recommended if you are using your client across the Internet, otherwise you are exposed to the man in the -middle attack and hence loss of your data. +middle attack and hence loss of your data. -See below for how to create a self-signed certificate. +See below for how to create a self-signed certificate. \section{Securing the Data Channel} \index[general]{Channel!Securing the Data } @@ -108,7 +105,7 @@ That is the connection between the File daemon and the Storage daemon, which takes place on port 9103. In fact, in a minimalist solution, this is the only connection that needs to be encrypted, because it is the one that transports your data. The connection between the Director and the File daemon is simply a -control channel used to start the job and get the job status. +control channel used to start the job and get the job status. Normally the File daemon will contact the Storage daemon on port 9103 (supplied by the Director), so we need an stunnel that listens on port 9103 on @@ -118,17 +115,17 @@ listening on port 9103 and sending to server:29103. We use port 29103 on the server because if we would send the data to port 9103, it would go directly to the Storage daemon, which doesn't understand encrypted data. On the server machine, we run Stunnel 4, which listens on port 29103, decrypts the data and -sends it to the Storage daemon, which is listening on port 9103. +sends it to the Storage daemon, which is listening on port 9103. \section{Data Channel Configuration} \index[general]{Modification of bacula-dir.conf for the Data Channel } \index[general]{baculoa-dir.conf!Modification for the Data Channel } The Storage resource of the bacula-dir.conf normally looks something like the -following: +following: \footnotesize -\begin{verbatim} +\begin{lstlisting} Storage { Name = File Address = server @@ -137,15 +134,15 @@ Storage { Device = File Media Type = File } -\end{verbatim} +\end{lstlisting} \normalsize Notice that this is running on the server machine, and it points the File daemon back to server:9103, which is where our Storage daemon is listening. We -modify this to be: +modify this to be: \footnotesize -\begin{verbatim} +\begin{lstlisting} Storage { Name = File Address = localhost @@ -154,34 +151,34 @@ Storage { Device = File Media Type = File } -\end{verbatim} +\end{lstlisting} \normalsize This causes the File daemon to send the data to the stunnel running on localhost (the client machine). We could have used client as the address as -well. +well. \section{Stunnel Configuration for the Data Channel} \index[general]{Stunnel Configuration for the Data Channel } In the diagram above, we see above Stunnel 2 that we use stunnel-fd2.conf on the -client. A pretty much minimal config file would look like the following: +client. A pretty much minimal config file would look like the following: \footnotesize -\begin{verbatim} +\begin{lstlisting} client = yes [29103] accept = localhost:9103 connect = server:29103 -\end{verbatim} +\end{lstlisting} \normalsize The above config file does encrypt the data but it does not require a certificate, so it is subject to the man in the middle attack. The file I -actually used, stunnel-fd2.conf, looked like this: +actually used, stunnel-fd2.conf, looked like this: \footnotesize -\begin{verbatim} +\begin{lstlisting} # # Stunnel conf for Bacula client -> SD # @@ -201,7 +198,7 @@ client = yes [29103] accept = localhost:9103 connect = server:29103 -\end{verbatim} +\end{lstlisting} \normalsize You will notice that I specified a pid file location because I ran stunnel @@ -211,20 +208,20 @@ permission. I also specified a certificate that I have as well as verify level location of the CA (Certificate Authority) certificate so that the stunnel certificate can be verified. Finally, you will see that there are two lines commented out, which when enabled, produce a lot of nice debug info in the -command window. +command window. If you do not have a signed certificate (stunnel.pem), you need to delete the -cert, CAfile, and verify lines. +cert, CAfile, and verify lines. Note that the stunnel.pem, is actually a private key and a certificate in a single file. These two can be kept and specified individually, but keeping -them in one file is more convenient. +them in one file is more convenient. The config file, stunnel-sd.conf, needed for Stunnel 4 on the server machine -is: +is: \footnotesize -\begin{verbatim} +\begin{lstlisting} # # Bacula stunnel conf for Storage daemon # @@ -241,7 +238,7 @@ client = no [29103] accept = 29103 connect = 9103 -\end{verbatim} +\end{lstlisting} \normalsize \section{Starting and Testing the Data Encryption} @@ -249,35 +246,35 @@ connect = 9103 \index[general]{Encryption!Starting and Testing the Data } It will most likely be the simplest to implement the Data Channel encryption -in the following order: +in the following order: \begin{itemize} \item Setup and run Bacula backing up some data on your client machine - without encryption. -\item Stop Bacula. -\item Modify the Storage resource in the Director's conf file. -\item Start Bacula -\item Start stunnel on the server with: + without encryption. +\item Stop Bacula. +\item Modify the Storage resource in the Director's conf file. +\item Start Bacula +\item Start stunnel on the server with: \footnotesize -\begin{verbatim} +\begin{lstlisting} stunnel stunnel-sd.conf - -\end{verbatim} + +\end{lstlisting} \normalsize -\item Start stunnel on the client with: +\item Start stunnel on the client with: \footnotesize -\begin{verbatim} +\begin{lstlisting} stunnel stunnel-fd2.conf - -\end{verbatim} + +\end{lstlisting} \normalsize -\item Run a job. +\item Run a job. \item If it doesn't work, turn debug on in both stunnel conf files, restart - the stunnels, rerun the job, repeat until it works. + the stunnels, rerun the job, repeat until it works. \end{itemize} \section{Encrypting the Control Channel} @@ -292,16 +289,16 @@ might normally listen on port 9102, but if you have a local File daemon, this will not work, so we make it listen on port 29102. It then sends the data to client:29102. Again we use port 29102 so that the stunnel on the client machine can decrypt the data before passing it on to port 9102 where the File -daemon is listening. +daemon is listening. \section{Control Channel Configuration} \index[general]{Control Channel Configuration } We need to modify the standard Client resource, which would normally look -something like: +something like: \footnotesize -\begin{verbatim} +\begin{lstlisting} Client { Name = client-fd Address = client @@ -309,13 +306,13 @@ Client { Catalog = BackupDB Password = "xxx" } -\end{verbatim} +\end{lstlisting} \normalsize -to be: +to be: \footnotesize -\begin{verbatim} +\begin{lstlisting} Client { Name = client-fd Address = localhost @@ -323,20 +320,20 @@ Client { Catalog = BackupDB Password = "xxx" } -\end{verbatim} +\end{lstlisting} \normalsize This will cause the Director to send the control information to -localhost:29102 instead of directly to the client. +localhost:29102 instead of directly to the client. \section{Stunnel Configuration for the Control Channel} \index[general]{Config Files for stunnel to Encrypt the Control Channel } The stunnel config file, stunnel-dir.conf, for the Director's machine would -look like the following: +look like the following: \footnotesize -\begin{verbatim} +\begin{lstlisting} # # Bacula stunnel conf for the Directory to contact a client # @@ -356,14 +353,14 @@ client = yes [29102] accept = localhost:29102 connect = client:29102 -\end{verbatim} +\end{lstlisting} \normalsize and the config file, stunnel-fd1.conf, needed to run stunnel on the Client -would be: +would be: \footnotesize -\begin{verbatim} +\begin{lstlisting} # # Bacula stunnel conf for the Directory to contact a client # @@ -383,7 +380,7 @@ client = yes [29102] accept = localhost:29102 connect = client:29102 -\end{verbatim} +\end{lstlisting} \normalsize \section{Starting and Testing the Control Channel} @@ -391,33 +388,33 @@ connect = client:29102 \index[general]{Channel!Starting and Testing the Control } It will most likely be the simplest to implement the Control Channel -encryption in the following order: +encryption in the following order: \begin{itemize} -\item Stop Bacula. -\item Modify the Client resource in the Director's conf file. -\item Start Bacula -\item Start stunnel on the server with: +\item Stop Bacula. +\item Modify the Client resource in the Director's conf file. +\item Start Bacula +\item Start stunnel on the server with: \footnotesize -\begin{verbatim} +\begin{lstlisting} stunnel stunnel-dir.conf - -\end{verbatim} + +\end{lstlisting} \normalsize -\item Start stunnel on the client with: +\item Start stunnel on the client with: \footnotesize -\begin{verbatim} +\begin{lstlisting} stunnel stunnel-fd1.conf - -\end{verbatim} + +\end{lstlisting} \normalsize -\item Run a job. +\item Run a job. \item If it doesn't work, turn debug on in both stunnel conf files, restart - the stunnels, rerun the job, repeat until it works. + the stunnels, rerun the job, repeat until it works. \end{itemize} \section{Using stunnel to Encrypt to a Second Client} @@ -425,14 +422,14 @@ encryption in the following order: \index[general]{Client!Using stunnel to Encrypt to a Second } On the client machine, you can just duplicate the setup that you have on the -first client file for file and it should work fine. +first client file for file and it should work fine. In the bacula-dir.conf file, you will want to create a second client pretty much identical to how you did for the first one, but the port number must be -unique. We previously used: +unique. We previously used: \footnotesize -\begin{verbatim} +\begin{lstlisting} Client { Name = client-fd Address = localhost @@ -440,16 +437,16 @@ Client { Catalog = BackupDB Password = "xxx" } -\end{verbatim} +\end{lstlisting} \normalsize so for the second client, we will, of course, have a different name, and we will also need a different port. Remember that we used port 29103 for the Storage daemon, so for the second client, we can use port 29104, and the -Client resource would look like: +Client resource would look like: \footnotesize -\begin{verbatim} +\begin{lstlisting} Client { Name = client2-fd Address = localhost @@ -457,14 +454,14 @@ Client { Catalog = BackupDB Password = "yyy" } -\end{verbatim} +\end{lstlisting} \normalsize Now, fortunately, we do not need a third stunnel to on the Director's machine, -we can just add the new port to the config file, stunnel-dir.conf, to make: +we can just add the new port to the config file, stunnel-dir.conf, to make: \footnotesize -\begin{verbatim} +\begin{lstlisting} # # Bacula stunnel conf for the Directory to contact a client # @@ -487,11 +484,11 @@ connect = client:29102 [29104] accept = localhost:29102 connect = client2:29102 -\end{verbatim} +\end{lstlisting} \normalsize There are no changes necessary to the Storage daemon or the other stunnel so -that this new client can talk to our Storage daemon. +that this new client can talk to our Storage daemon. \section{Creating a Self-signed Certificate} \index[general]{Creating a Self-signed Certificate } @@ -500,10 +497,10 @@ that this new client can talk to our Storage daemon. You may create a self-signed certificate for use with stunnel that will permit you to make it function, but will not allow certificate validation. The .pem file containing both the certificate and the key can be made with the -following, which I put in a file named {\bf makepem}: +following, which I put in a file named {\bf makepem}: \footnotesize -\begin{verbatim} +\begin{lstlisting} #!/bin/sh # # Simple shell script to make a .pem file that can be used @@ -519,7 +516,7 @@ OPENSSL=openssl echo "" >>stunnel.pem cat $PEM2 >>stunnel.pem rm $PEM1 $PEM2 -\end{verbatim} +\end{lstlisting} \normalsize The above script will ask you a number of questions. You may simply answer @@ -532,22 +529,22 @@ each of them by entering a return, or if you wish you may enter your own data. The process of getting a certificate that is signed by a CA is quite a bit more complicated. You can purchase one from quite a number of PKI vendors, but -that is not at all necessary for use with Bacula. +that is not at all necessary for use with Bacula. To get a CA signed certificate, you will either need to find a friend that has setup his own CA or to become a CA yourself, and thus you can sign all your own certificates. The book OpenSSL by John Viega, Matt Mesier \& Pravir Chandra from O'Reilly explains how to do it, or you can read the documentation provided in the -Open-source PKI Book project at Source Forge: +Open-source PKI Book project at Source Forge: \elink{ http://ospkibook.sourceforge.net/docs/OSPKI-2.4.7/OSPKI-html/ospki-book.htm} {http://ospkibook.sourceforge.net/docs/OSPKI-2.4.7/OSPKI-html/ospki-book.htm}. -Note, this link may change. +Note, this link may change. \section{Using ssh to Secure the Communications} \index[general]{Communications!Using ssh to Secure the } \index[general]{Using ssh to Secure the Communications } Please see the script {\bf ssh-tunnel.sh} in the {\bf examples} directory. It -was contributed by Stephan Holl. +was contributed by Stephan Holl. diff --git a/docs/manuals/en/misc/table_sqlitevsmysql.tex b/docs/manuals/en/misc/table_sqlitevsmysql.tex new file mode 100644 index 00000000..ba17fe5c --- /dev/null +++ b/docs/manuals/en/misc/table_sqlitevsmysql.tex @@ -0,0 +1,51 @@ +\begin{longtable}{|X|c|c|} + \hline + \multicolumn{1}{|c|}{\bf Feature} + & \multicolumn{1}{c|}{\bf SQLite or MySQL} + & \multicolumn{1}{c| }{\bf Bacula} \\ + \endfirsthead + \hline + \multicolumn{1}{|c|}{\bf Feature} + & \multicolumn{1}{c|}{\bf SQLite or MySQL} + & \multicolumn{1}{c| }{\bf Bacula} \\ + \endhead + \multicolumn{3}{c}{Cont. on next page} \\ + \endfoot + \caption{SQLite versus MySQL database comparison} \\ + \endlastfoot + \hline + Job Record & Yes & Yes \\ + \hline + Media Record & Yes & Yes \\ + \hline + FileName Record & Yes & No \\ + \hline + File Record & Yes & No \\ + \hline + FileSet Record & Yes & Yes \\ + \hline + Pool Record & Yes & Yes \\ + \hline + Client Record & Yes & Yes \\ + \hline + JobMedia Record & Yes & Yes \\ + \hline + List Job Records & Yes & Yes \\ + \hline + List Media Records & Yes & Yes \\ + \hline + List Pool Records & Yes & Yes \\ + \hline + List JobMedia Records & Yes & Yes \\ + \hline + Delete Pool Record & Yes & Yes \\ + \hline + Delete Media Record & Yes & Yes \\ + \hline + Update Pool Record & Yes & Yes \\ + \hline + Implement Verify & Yes & No \\ + \hline + MD5 Signatures & Yes & No \\ + \hline +\end{longtable} diff --git a/docs/manuals/en/misc/vars.tex b/docs/manuals/en/misc/vars.tex index b03c3acc..10d86e99 100644 --- a/docs/manuals/en/misc/vars.tex +++ b/docs/manuals/en/misc/vars.tex @@ -1,6 +1,3 @@ -%% -%% - \chapter{Variable Expansion} \label{VarsChapter} \index[general]{Variable Expansion } @@ -8,13 +5,13 @@ % TODO: does the following mean that this should not be in book? -Please note that as of version 1.37, the Variable Expansion +Please note that as of version 1.37, the Variable Expansion is deprecated and replaced by Python scripting (not yet documented). Variable expansion is somewhat similar to Unix shell variable expansion. Currently (version 1.31), it is used only in format labels, but in the future, -it will most likely be used in more places. +it will most likely be used in more places. \section{General Functionality} \index[general]{Functionality!General } @@ -25,23 +22,23 @@ variables, indexing arrays, conditional replacement of variables, case conversion, substring selection, regular expression matching and replacement, character class replacement, padding strings, repeated expansion in a user controlled loop, support of arithmetic expressions in the loop start, step and -end conditions, and recursive expansion. +end conditions, and recursive expansion. When using variable expansion characters in a Volume Label Format record, the -format should always be enclosed in double quotes ({\bf "}). +format should always be enclosed in double quotes ({\bf "}). For example, {\bf \$\{HOME\}} will be replaced by your home directory as defined in the environment. If you have defined the variable {\bf xxx} to be {\bf Test}, then the reference {\bf \$\{xxx:p/7/Y/r\}} will right pad the contents of {\bf xxx} to a length of seven characters filling with the -character {\bf Y} giving {\bf YYYTest}. +character {\bf Y} giving {\bf YYYTest}. \section{Bacula Variables} \index[general]{Bacula Variables } \index[general]{Variables!Bacula } Within Bacula, there are three main classes of variables with some minor -variations within the classes. The classes are: +variations within the classes. The classes are: \begin{description} @@ -49,37 +46,37 @@ variations within the classes. The classes are: \index[general]{Counters } Counters are defined by the {\bf Counter} resources in the Director's conf file. The counter can either be a temporary counter that lasts for the -duration of Bacula's execution, or it can be a variable that is stored in +duration of Bacula's execution, or it can be a variable that is stored in the catalog, and thus retains its value from one Bacula execution to another. Counter variables may be incremented by postfixing a plus sign ({\bf +} after -the variable name). +the variable name). \item [Internal Variables] \index[general]{Internal Variables } Internal variables are read-only, and may be related to the current job (i.e. Job name), or maybe special variables such as the date and time. The -following variables are available: +following variables are available: \begin{itemize} -\item [Year] -- the full year -\item [Month] -- the current month 1-12 -\item [Day] -- the day of the month 1-31 -\item [Hour] -- the hour 0-24 -\item [Minute] -- the current minute 0-59 -\item [Second] -- the current second 0-59 -\item [WeekDay] -- the current day of the week 0-6 with 0 being Sunday -\item [Job] -- the job name -\item [general] -- the Director's name -\item [Level] -- the Job Level -\item [Type] -- the Job type -\item [JobId] -- the JobId -\item [JobName] -- the unique job name composed of Job and date -\item [Storage] -- the Storage daemon's name -\item [Client] -- the Client's name -\item [NumVols] -- the current number of Volumes in the Pool -\item [Pool] -- the Pool name -\item [Catalog] -- the Catalog name -\item [MediaType] -- the Media Type +\item [Year] -- the full year +\item [Month] -- the current month 1-12 +\item [Day] -- the day of the month 1-31 +\item [Hour] -- the hour 0-24 +\item [Minute] -- the current minute 0-59 +\item [Second] -- the current second 0-59 +\item [WeekDay] -- the current day of the week 0-6 with 0 being Sunday +\item [Job] -- the job name +\item [general] -- the Director's name +\item [Level] -- the Job Level +\item [Type] -- the Job type +\item [JobId] -- the JobId +\item [JobName] -- the unique job name composed of Job and date +\item [Storage] -- the Storage daemon's name +\item [Client] -- the Client's name +\item [NumVols] -- the current number of Volumes in the Pool +\item [Pool] -- the Pool name +\item [Catalog] -- the Catalog name +\item [MediaType] -- the Media Type \end{itemize} \item [Environment Variables] @@ -87,12 +84,12 @@ following variables are available: Environment variables are read-only, and must be defined in the environment prior to executing Bacula. Environment variables may be either scalar or an array, where the elements of the array are referenced by subscripting the -variable name (e.g. {\bf \$\{Months[3]\}}). Environment variable arrays are +variable name (e.g. {\bf \$\{Months[3]\}}). Environment variable arrays are defined by separating the elements with a vertical bar ({\bf |}), thus {\bf set Months="Jan|Feb|Mar|Apr|..."} defines an environment variable named {\bf Month} that will be treated as an array, and the reference {\bf -\$\{Months[3]\}} will yield {\bf Mar}. The elements of the array can have -differing lengths. +\$\{Months[3]\}} will yield {\bf Mar}. The elements of the array can have +differing lengths. \end{description} \section{Full Syntax} @@ -100,10 +97,10 @@ differing lengths. \index[general]{Full Syntax } Since the syntax is quite extensive, below, you will find the pseudo BNF. The -special characters have the following meaning: +special characters have the following meaning: \footnotesize -\begin{verbatim} +\begin{lstlisting} ::= definition ( ) grouping if the parens are not quoted | separates alternatives @@ -112,13 +109,13 @@ special characters have the following meaning: * preceding item can be repeated zero or more times ? preceding item can appear zero or one time + preceding item must appear one or more times -\end{verbatim} +\end{lstlisting} \normalsize -And the pseudo BNF describing the syntax is: +And the pseudo BNF describing the syntax is: \footnotesize -\begin{verbatim} +\begin{lstlisting} input ::= ( TEXT | variable | INDEX_OPEN input INDEX_CLOSE (loop_limits)? @@ -170,17 +167,17 @@ And the pseudo BNF describing the syntax is: INDEX_CLOSE ::= ']' INDEX_MARK ::= '#' NAME_CHARS ::= 'a'|...|'z'|'A'|...|'Z'|'0'|...|'9' -\end{verbatim} +\end{lstlisting} \normalsize \section{Semantics} \index[general]{Semantics } The items listed in {\bf command} above, which always follow a colon ({\bf :}) -have the following meanings: +have the following meanings: \footnotesize -\begin{verbatim} +\begin{lstlisting} - perform substitution if variable is empty + perform substitution if variable is not empty o cut out substring of the variable value @@ -196,34 +193,34 @@ have the following meanings: % special function call (none implemented) l lower case the variable value u upper case the variable value -\end{verbatim} +\end{lstlisting} \normalsize -The {\bf loop\_limits} are start, step, and end values. +The {\bf loop\_limits} are start, step, and end values. A counter variable name followed immediately by a plus ({\bf +}) will cause -the counter to be incremented by one. +the counter to be incremented by one. \section{Examples} \index[general]{Examples } -To create an ISO date: +To create an ISO date: \footnotesize -\begin{verbatim} +\begin{lstlisting} DLT-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r} -\end{verbatim} +\end{lstlisting} \normalsize -on 20 June 2003 would give {\bf DLT-2003-06-20} +on 20 June 2003 would give {\bf DLT-2003-06-20} -If you set the environment variable {\bf mon} to +If you set the environment variable {\bf mon} to \footnotesize -\begin{verbatim} +\begin{lstlisting} January|February|March|April|May|... File-${mon[${Month}]}/${Day}/${Year} -\end{verbatim} +\end{lstlisting} \normalsize -on the first of March would give {\bf File-March/1/2003 } +on the first of March would give {\bf File-March/1/2003 } diff --git a/docs/manuals/en/problems/Makefile.in b/docs/manuals/en/problems/Makefile.in index f8ebad0c..bfd60bc8 100644 --- a/docs/manuals/en/problems/Makefile.in +++ b/docs/manuals/en/problems/Makefile.in @@ -36,37 +36,83 @@ IMAGES=../../../images +MANUALSDIR=../.. DOC=problems MAINDOC=Bacula_Problem_Resolution_G.html +BSYSMANUALDIR=../../../bsysmanual +COVERSDIR=../../../covers +PDFCOVERSDIR=$(COVERSDIR)/pdf +SVGCOVERSDIR=$(COVERSDIR)/svg +EPSCOVERSDIR=$(COVERSDIR)/eps +LICENSESDIR=$(MANUALSDIR)/licences +COVERNAME=coverpage-problems +BSYSMANNAME=bsysmanual-coverpagebackground +LICENCES=$(wildcard $(LICENSESDIR)/*.tex) +BSYSCOMPILERFILE=bsys-compiler-mode.tex +PDFCOMPILERFILE=$(MANUALSDIR)/bsys-pdflatex-mode.tex +TEXCOMPILERFILE=$(MANUALSDIR)/bsys-latex-mode.tex +WEBCOMPILERFILE=$(MANUALSDIR)/bsys-web-mode.tex first_rule: all -all: tex web dvipdf mini-clean +all: tex pdflatex mini-clean .SUFFIXES: .tex .html .PHONY: .DONTCARE: - -tex: +pdfcovers: + @echo -n "Linking coverpage and background PDF format..." + @(cd $(SVGCOVERSDIR) ; make pdf) + @ln -sf `pwd`/${PDFCOVERSDIR}/${COVERNAME}.pdf `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf + @echo "Done." + +pdfimages: + @echo "Generating PDF images..." + @(cd ${IMAGES}/svg ; make pdf) + @echo "Done." + +pngimages: + @echo "Generating PNG images..." + @(cd ${IMAGES}/svg ; make png) + @echo "Done." + +epsimages: + @echo "Generating EPS images..." + @(cd ${IMAGES}/svg ; make eps) + @rm -rf ${IMAGES}/png + @rm -rf ${IMAGES}/pdf + @echo "Done." + +epscovers: + @echo -n "Linking coverpage and background EPS format..." + @(cd $(SVGCOVERSDIR) ; make eps) + @ln -sf `pwd`/${EPSCOVERSDIR}/${COVERNAME}.eps `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.eps + @rm -f `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf + @echo "Done." + +commonfiles: @../../update_version @echo "Making version `cat version.tex`" - @cp -fp ${IMAGES}/hires/*.eps . + @echo -n "Linking shared files..." + @(for L in $(LICENCES); do ln -sf $$L .; done) + @echo "Done" + +tex: epscovers epsimages commonfiles + @ln -sf $(TEXCOMPILERFILE) $(BSYSCOMPILERFILE) @touch ${DOC}i-dir.tex ${DOC}i-fd.tex ${DOC}i-sd.tex \ ${DOC}i-console.tex ${DOC}i-general.tex latex -interaction=batchmode ${DOC}.tex makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null latex -interaction=batchmode ${DOC}.tex -pdf: - @echo "Making pdfm" - @cp -fp ${IMAGES}/hires/*.eps . - dvipdfm -p a4 ${DOC}.dvi -dvipdf: - @echo "Making dvi to pdf" - @cp -fp ${IMAGES}/hires/*.eps . - dvipdf ${DOC}.dvi ${DOC}.pdf +pdflatex: pdfcovers pdfimages commonfiles + @ln -sf $(PDFCOMPILERFILE) $(BSYSCOMPILERFILE) + pdflatex -interaction=batchmode ${DOC}.tex + makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null + pdflatex -interaction=batchmode ${DOC}.tex + pdflatex -interaction=batchmode ${DOC}.tex html: @echo " " @@ -111,6 +157,7 @@ main_configs: pic2graph -density 100 main_configs.png mini-clean: + @find . -type l -name "*.tex" -exec rm {} \; @rm -f 1 2 3 *.tex~ @rm -f *.gif *.jpg *.eps @rm -f *.aux *.cp *.fn *.ky *.log *.pg @@ -127,6 +174,7 @@ mini-clean: clean: + @find . -type l -name "*.tex" -exec rm {} \; @rm -f 1 2 3 *.tex~ @rm -f *.png *.gif *.jpg *.eps @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg diff --git a/docs/manuals/en/problems/faq.tex b/docs/manuals/en/problems/faq.tex index 2fff751a..40ac3b6f 100644 --- a/docs/manuals/en/problems/faq.tex +++ b/docs/manuals/en/problems/faq.tex @@ -1,5 +1,3 @@ -%% -%% % TODO: maybe merge all this FAQ in with the appropriate section? % TODO: and use detailed indexing to help reader @@ -10,12 +8,12 @@ These are questions that have been submitted over time by the Bacula users. The following -FAQ is very useful, but it is not always up to date -with newer information, so after reading it, if you don't find what you +FAQ is very useful, but it is not always up to date +with newer information, so after reading it, if you don't find what you want, you might try the Bacula wiki maintained by Frank Sweetser, which contains more than just a FAQ: \elink{http://wiki.bacula.org}{http://wiki.bacula.org} -or go directly to the FAQ at: +or go directly to the FAQ at: \elink{http://wiki.bacula.org/doku.php?id=faq} {http://wiki.bacula.org/doku.php?id=faq}. @@ -28,7 +26,7 @@ of known bugs and solutions. \section{What is Bacula?} \item [What is {\bf Bacula}? ] \index[general]{What is Bacula? } - {\bf Bacula} is a network backup and restore program. + {\bf Bacula} is a network backup and restore program. \section{Does Bacula support Windows?} \item [Does Bacula support Windows?] @@ -38,7 +36,7 @@ of known bugs and solutions. (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. - + \label{lang} \section{What language is Bacula written in?} @@ -48,7 +46,7 @@ of known bugs and solutions. 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++. + adding a larger subset of C++. \label{run} \section{On what machines does Bacula run?} @@ -61,7 +59,7 @@ of known bugs and solutions. Bacula has been my only backup tool for over seven years backing up 8 machines nightly (6 Linux boxes running SuSE, previously Red Hat and Fedora, a WinXP machine, and a WinNT machine). - + \label{stable} \section{Is Bacula Stable?} @@ -83,14 +81,14 @@ of known bugs and solutions. crashes. Of 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. + There are a number of reasons for this stability. \begin{enumerate} \item The program is constantly checking the chain of allocated memory buffers to ensure that no overruns have occurred. \\ \item All memory leaks (orphaned buffers) are reported each time the program terminates.\\ - \item Any signal (segmentation fault, ...) generates a + \item Any signal (segmentation fault, ...) generates a traceback that is emailed to the developer. This permits quick resolution of bugs even if they only show up rarely in a production system.\\ @@ -108,7 +106,7 @@ of known bugs and solutions. Storage daemon know the name of the Director as well as its password. As a consequence, if you change the Director's name or password, you must make the corresponding change in the Storage daemon's and in the File daemon's - configuration files. + configuration files. During the authorization process, the Storage daemon and File daemon also require that the Director authenticates itself, so both ends @@ -119,8 +117,8 @@ of known bugs and solutions. back to the original conf files generated by the Bacula installation process. Make only the absolutely necessary modifications to these files -- e.g. add the correct email address. Then follow the - instructions in the \ilink{ Running Bacula}{TutorialChapter} chapter of - this manual. You will run a backup to disk and a restore. Only when + instructions in the \bsysxrlink{Running Bacula}{TutorialChapter}{main}{chapter} of + the \mainman{}. You will run a backup to disk and a restore. Only when that works, should you begin customization of the conf files. Another reason that you can get authentication errors is if you are @@ -143,13 +141,13 @@ of known bugs and solutions. Here is a picture that indicates what names/passwords in which files/Resources must match up: - \includegraphics{\idir Conf-Diagram.eps} + \bsysimageH{Conf-Diagram}{Configuration Diagram}{} In the left column, you will find the Director, Storage, and Client resources, with their names and passwords -- these are all in {\bf bacula-dir.conf}. The right column is where the corresponding values should be found in the Console, Storage daemon (SD), and File daemon (FD) - configuration files. + configuration files. Another thing to check is to ensure that the Bacula component you are trying to access has {\bf Maximum Concurrent Jobs} set large enough to @@ -167,26 +165,26 @@ of known bugs and solutions. Why? ] \index[general]{Cannot Access a Client} There are several reasons why Bacula could not contact a client on a - different machine. They are: + different machine. They are: \begin{itemize} \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. + record. \item You have a firewall, and it is blocking traffic on port 9102 between the Director's machine and the Client's machine (or on port 9103 between the - Client and the Storage daemon machines). + Client and the Storage daemon machines). \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 between 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, + 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. \item You may have a {\bf hosts.allow} or {\bf hosts.deny} file that is @@ -200,36 +198,36 @@ of known bugs and solutions. If you are using MySQL do the following: \footnotesize -\begin{verbatim} +\begin{lstlisting} cd /src/cats ./drop_mysql_tables ./make_mysql_tables - -\end{verbatim} + +\end{lstlisting} \normalsize If you are using SQLite, do the following: \footnotesize -\begin{verbatim} +\begin{lstlisting} Delete bacula.db from your working directory. cd /src/cats ./drop_sqlite_tables ./make_sqlite_tables - -\end{verbatim} + +\end{lstlisting} \normalsize -Then write an EOF on each tape you used with {\bf Bacula} using: +Then write an EOF on each tape you used with {\bf Bacula} using: \footnotesize -\begin{verbatim} +\begin{lstlisting} mt -f /dev/st0 rewind mt -f /dev/st0 weof -\end{verbatim} +\end{lstlisting} \normalsize -where you need to adjust the device name for your system. +where you need to adjust the device name for your system. \label{restorehang} \section{I Run a Restore Job and Bacula Hangs. What do I do?} @@ -254,8 +252,7 @@ where you need to adjust the device name for your system. Installation commands necessary to install it as a Windows Service. For the first problem, see the next FAQ question. For the second - problem, please review the \ilink{ Windows Installation - instructions}{Win32Chapter} in this manual. + problem, please review the \bsysxrlink{Windows Installation Instructions}{Win32Chapter}{main}{chapter} in the\mainman{}. \label{windowsdie} \section{My Windows Client Immediately Dies When I Start It} @@ -267,19 +264,19 @@ You must have the configuration file in {\bf c:\textbackslash{}bacula\textbackslash{}bin\textbackslash{}bacula-fd.conf}. To {\bf see} what is going on when the File daemon starts on Windows, do the -following: +following: \footnotesize -\begin{verbatim} +\begin{lstlisting} Start a DOS shell Window. cd c:\bacula\bin bacula-fd -d100 -c c:\bacula\bin\bacula-fd.conf - -\end{verbatim} + +\end{lstlisting} \normalsize This will cause the FD to write a file {\bf bacula.trace} in the current -directory, which you can examine and thereby determine the problem. +directory, which you can examine and thereby determine the problem. \label{scroll} \item [When I Start the Console, the Error Messages Fly By. How can I see @@ -292,30 +289,30 @@ directory, which you can examine and thereby determine the problem. Message resource definition: \footnotesize -\begin{verbatim} +\begin{lstlisting} append = "/home/kern/bacula/bin/log" = all, !skipped - -\end{verbatim} + +\end{lstlisting} \normalsize Obviously you will want to change the filename to be appropriate for your -system. +system. \label{nobackup} -\section{My backups are not working on my Windows +\section{My backups are not working on my Windows Client. What should I do?} -\item [I didn't realize that the backups were not working on my Windows +\item [I didn't realize that the backups were not working on my Windows Client. What should I do? ] \index[general]{Backups Failing} You should be sending yourself an email message for each job. This will avoid the possibility of not knowing about a failed backup. To do so put something -like: +like: \footnotesize -\begin{verbatim} +\begin{lstlisting} Mail = yourname@yourdomain = all, !skipped - -\end{verbatim} + +\end{lstlisting} \normalsize in your Director's message resource. You should then receive one email for @@ -323,17 +320,17 @@ each Job that ran. When you are comfortable with what is going on (it took me 9 months), you might change that to: \footnotesize -\begin{verbatim} +\begin{lstlisting} MailOnError = yourname@yourdomain = all, !skipped - -\end{verbatim} + +\end{lstlisting} \normalsize then you only get email messages when a Job errors as is the case for your -Windows machine. +Windows machine. You should also be logging the Director's messages, please see the previous -FAQ for how to do so. +FAQ for how to do so. \label{sched} \section{All my Jobs are scheduled for the same time. Will this cause @@ -355,19 +352,19 @@ FAQ for how to do so. Yes, in principle, Bacula can backup to any storage medium as long as you have correctly defined that medium in the Storage daemon's Device resource. For an example of how to backup to files, please see the - \ilink{Pruning Example}{PruningExample} in the Recycling chapter of this - manual. Also, there is a whole chapter devoted to \ilink{Basic Volume - Management}{DiskChapter}. This chapter was originally written to + \bsysxrlink{Pruning Example}{PruningExample}{main}{chapter} of the \mainman{}. + Also, there is a whole chapter devoted to \bsysxrlink{Basic Volume + Management}{DiskChapter}{main}{chapter} in the \mainman{}. This chapter was originally written to explain how to write to disk, but was expanded to include volume management. It is, however, still quite a good chapter to read. \label{testbackup} \section{Can I use a dummy device to test the backup?} - Yes, to have a {\sl Virtual} device which just consumes data, you can use a - FIFO device (see \ilink{Stored configuration}{SetupFifo}). - It's useful to test a backup. + Yes, to have a \emph{Virtual} device which just consumes data, you can use a + FIFO device (see \bsysxrlink{Stored configuration}{SetupFifo}{main}{chapter} + in the \mainman{}). It's useful to test a backup. \footnotesize -\begin{verbatim} +\begin{lstlisting} Device { Name = NULL Media Type = NULL @@ -380,7 +377,7 @@ Device { MaximumOpenWait = 60 AlwaysOpen = no } -\end{verbatim} +\end{lstlisting} \normalsize \label{bigfiles} @@ -396,7 +393,7 @@ system supported by Bacula can handle files bigger 2 Gigabytes. %% Is there a better way than "./bacula stop" to stop it?} \item [I Started A Job then Decided I Really Did Not Want to Run It. Is there a better way than {\bf ./bacula stop} to stop it?] -\index[general]{Cancelling jobs} +\index[general]{Cancelling jobs} Yes, you normally should use the Console command {\bf cancel} to cancel a Job that is either scheduled or running. If the Job is scheduled, it will be marked for cancellation and will be canceled when it is @@ -425,7 +422,7 @@ useful to our users, so we publish the very latest document. Fortunately it is rare that there are confusions with new features. If you want to read a document that pertains only to a specific version, -please use the one distributed in the source code. The web site also has +please use the one distributed in the source code. The web site also has online versions of both the released manual and the current development manual. @@ -435,8 +432,8 @@ manual. \index[general]{Checking Restores} It is really quite simple, but took me a while to figure out how to "prove" it. First make a Bacula Rescue disk, see the - \ilink{Disaster Recovery Using Bacula}{RescueChapter} chapter - of this manual. + \ilink{Disaster Recovery Using Bacula}{RescueChapter}{main}{chapter} + of the \mainman{}. Second, you run a full backup of all your files on all partitions. Third, you run an Verify InitCatalog Job on the same FileSet, which effectively makes a record of all the files on your system. Fourth, you @@ -476,14 +473,13 @@ manual. or selecting a FileSet. For more on backup levels see below. See also {\bf Ignore FileSet Changes} in the - \ilink{FileSet Resource definition}{FileSetResource} in the Director - chapter of this document. + \bsysxrlink{FileSet Resource definition}{FileSetResource}{main}{chapter} in the \mainman{}. \label{filenamelengths} \section{Do you really handle unlimited path lengths?} \item [How Can You Claim to Handle Unlimited Path and Filename Lengths when All Other Programs Have Fixed Limits?] -\index[general]{Path and Filename Lengths} +\index[general]{Path and Filename Lengths} Most of those other programs have been around for a long time, in fact since the beginning of Unix, which means that they were designed for rather small fixed length path and filename lengths. Over the years, @@ -500,7 +496,7 @@ manual. \label{unique} \section{What Is the Really Unique Feature of Bacula?} \item [What Is the Really Unique Feature of Bacula?] -\index[general]{Unique Feature of Bacula} +\index[general]{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 Bacula is the first and only program to use a standard SQL @@ -522,8 +518,9 @@ manual. Particular Job to Run After Another Job? ] \index[general]{Multiple Simultaneous Jobs} Yes, you can set Priorities on your jobs so that they run in the order you -specify. Please see: -\ilink{the Priority record}{Priority} in the Job resource. +specify. Please see: +\bsysxrlink{the Priority record}{Priority}{main}{chapter} of the \mainman{} in +the Job resource. \label{nomail} \section{I Am Not Getting Email Notification, What Can I Do? } @@ -533,12 +530,12 @@ specify. Please see: email address and your bsmtp server is rejecting the mail. The next most common problem is that your bsmtp server doesn't like the syntax on the From part of the message. For more details on this and other - problems, please see the \ilink{ Getting Email Notification to + problems, please see the \ilink{Getting Email Notification to Work}{email} section of the Tips chapter of this manual. The section \ilink{ Getting Notified of Job Completion}{notification} of the Tips chapter may also be useful. For more information on the {\bf bsmtp} - mail program, please see \ilink{bsmtp in the Volume Utility Tools - chapter}{bsmtp} of this manual. + mail program, please see \bsysxrlink{bsmtp}{bsmtp}{utility}{command} in the + \utilityman{}. \label{periods} \section{My retention periods don't work} @@ -552,14 +549,14 @@ specify. Please see: Bacula versions prior to 1.30, after changing your Pool Resource, you must manually update the corresponding values in the Catalog by using the {\bf update pool} command in the Console program. In Bacula version 1.30, Bacula - does this for you automatically every time it starts. - + does this for you automatically every time it starts. + When Bacula creates a Media record (Volume), it uses many default values from the Pool record. If you subsequently change the Pool record, the new values will be used as a default for the next Volume that is created, but if you want the new values to apply to existing Volumes, you must manually update the Volume Catalog entry using the {\bf update volume} command in the Console - program. + program. \label{CompressionNotWorking} \section{Why aren't my files compressed?} @@ -568,10 +565,10 @@ specify. Please see: \index[general]{Compression} There are two kinds of compression. One is tape compression. This is done by the tape drive hardware, and you either enable or disable it with system - tools such as {\bf mt}. This compression works independently of Bacula, - and when it is enabled, you should not use the Bacula software + tools such as {\bf mt}. This compression works independently of Bacula, + and when it is enabled, you should not use the Bacula software compression. - + Bacula also has software compression code in the File daemons, which you normally need to enable only when backing up to file Volumes. There are two conditions necessary to enable the Bacula software compression. @@ -586,32 +583,32 @@ specify. Please see: be mentioned in the {\bf config.out} line by: \footnotesize -\begin{verbatim} +\begin{lstlisting} ZLIB support: yes - -\end{verbatim} + +\end{lstlisting} \normalsize \item You must add the {\bf compression=gzip} option on your Include - statement in the Director's configuration file. + statement in the Director's configuration file. \end{enumerate} \label{NewTape} \item [Bacula is Asking for a New Tape After 2 GB of Data but My Tape holds 33 GB. Why?] \index[general]{Tape capacity} -There are several reasons why Bacula will request a new tape. +There are several reasons why Bacula will request a new tape. \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 error. -\item Bacula encounters and end of medium on the tape. This is not always - distinguishable from an I/O error. + I/O error. +\item Bacula encounters and end of medium on the tape. This is not always + distinguishable from an I/O error. \item You have specifically set some size limitation on the tape. For example the {\bf Maximum Volume Bytes} or {\bf Maximum Volume Files} in the Director's Pool resource, or {\bf Maximum Volume Size} in the Storage - daemon's Device resource. + daemon's Device resource. \end{itemize} \label{LevelChanging} @@ -623,29 +620,28 @@ There are several reasons why Bacula will request a new tape. 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 chapter of - this manual. - + \bsysxrlink{Level record}{Level}{main}{chapter} in the \mainman{}. + If after reading the above mentioned section, you believe that Bacula is not correctly handling the level (Differential/Incremental), please send us the - following information for analysis: + following information for analysis: \begin{itemize} -\item Your Director's configuration file. +\item Your Director's configuration file. \item The output from {\bf list jobs} covering the period where you are - having the problem. -\item The Job report output from the prior Full save (not critical). + having the problem. +\item The Job report output from the prior Full save (not critical). \item An {\bf llist jobid=nnn} where nnn is the JobId of the prior Full save. - + \item The Job report output from the save that is doing the wrong thing (not - critical). + critical). \item An {\bf llist jobid=nnn} where nnn is the JobId of the job that was not - correct. -\item An explanation of what job went wrong and why you think it did. + correct. +\item An explanation of what job went wrong and why you think it did. \end{itemize} -The above information can allow us to analyze what happened, without it, -there is not much we can do. +The above information can allow us to analyze what happened, without it, +there is not much we can do. \label{WaitForever} \section{I am waiting forever for a backup of an offsite machine} @@ -657,27 +653,27 @@ there is not much we can do. connection between all the daemons. As a consequence, the current Bacula 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. + + There are several things you can do to improve the situation. \begin{itemize} \item Upgrade to version 1.32 and use the new SDConnectTimeout record. For - example, set: + example, set: \footnotesize -\begin{verbatim} +\begin{lstlisting} SD Connect Timeout = 5 min - -\end{verbatim} + +\end{lstlisting} \normalsize -in the FileDaemon resource. -\item Run these kinds of jobs after all other jobs. +in the FileDaemon resource. +\item Run these kinds of jobs after all other jobs. \end{itemize} \label{sshHanging} \section{SSH hangs forever after starting Bacula} -\item [When I ssh into a machine and start Bacula then attempt to exit, +\item [When I ssh into a machine and start Bacula then attempt to exit, ssh hangs forever.] \index[general]{ssh hangs} This happens because Bacula leaves stdin, stdout, and stderr open for @@ -685,19 +681,19 @@ in the FileDaemon resource. the output of those files to {\bf /dev/null} or another file in your startup script (the Red Hat autostart scripts do this automatically). For example, you start the Director with: - + \footnotesize -\begin{verbatim} +\begin{lstlisting} bacula-dir -c bacula-dir.conf ... >/dev/null 0>\&1 2>\&1 - -\end{verbatim} + +\end{lstlisting} \normalsize -and likewise for the other daemons. +and likewise for the other daemons. \label{RetentionPeriods} \section{I'm confused by retention periods} -\item [I'm confused by the different Retention periods: File Retention, +\item [I'm confused by the different Retention periods: File Retention, Job Retention, Volume Retention. Why are there so many?] \index[general]{Retention Periods} Yes, this certainly can be confusing. The basic reason for so many is @@ -710,7 +706,7 @@ and likewise for the other daemons. individual file since Bacula no longer knows 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 from getting too big, but I keep my tapes for a minimum of one year, just in case. @@ -725,20 +721,20 @@ and likewise for the other daemons. the Media record by doing: \footnotesize -\begin{verbatim} +\begin{lstlisting} llist Volume=xxx -\end{verbatim} +\end{lstlisting} \normalsize -If it doesn't have the right value, you can use: +If it doesn't have the right value, you can use: \footnotesize -\begin{verbatim} +\begin{lstlisting} update Volume=xxx -\end{verbatim} +\end{lstlisting} \normalsize -to change it. +to change it. \label{ConnectionRefused} \section{I get a Connection refused when connecting to my Client} @@ -747,31 +743,31 @@ to change it. \index[general]{ERR:Connection Refused} This is typically a communications error resulting from one of the following: - + \begin{itemize} \item Old versions of Bacula, usually a Win32 client, where two threads were - using the same I/O packet. Fixed in more recent versions. Please upgrade. + using the same I/O packet. Fixed in more recent versions. Please upgrade. \item Some other program such as an HP Printer using the same port (9102 in - this case). + this case). \end{itemize} -If it is neither of the above, please submit a bug report at -\elink{bugs.bacula.org}{http://bugs.bacula.org}. +If it is neither of the above, please submit a bug report at +\elink{bugs.bacula.org}{http://bugs.bacula.org}. -Another solution might be to run the daemon with the debug option by: +Another solution might be to run the daemon with the debug option by: \footnotesize -\begin{verbatim} +\begin{lstlisting} Start a DOS shell Window. cd c:\bacula\bin bacula-fd -d100 -c c:\bacula\bin\bacula-fd.conf - -\end{verbatim} + +\end{lstlisting} \normalsize This will cause the FD to write a file {\bf bacula.trace} in the current -directory, which you can examine to determine the problem. +directory, which you can examine to determine the problem. \section{Long running jobs die with Pipe Error} \item [During long running jobs my File daemon dies with Pipe Error, or @@ -784,43 +780,43 @@ directory, which you can examine to determine the problem. 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. + 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). + 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, or use the following workaround as suggested by Thomas Simmons for Win32 machines: - + Browse to: Start \gt{} Control Panel \gt{} Network Connections - Right click the connection for the nvidia adapter and select properties. - Under the General tab, click "Configure...". Under the Advanced tab set - "Checksum Offload" to disabled and click OK to save the change. + Right click the connection for the nvidia adapter and select properties. + Under the General tab, click "Configure...". Under the Advanced tab set + "Checksum Offload" to disabled and click OK to save the change. 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} +\begin{lstlisting} iptables -t filter -A INPUT -m limit --limit 3/second --limit-burst 3 -j DROP -\end{verbatim} +\end{lstlisting} \normalsize you will want to add the following rules {\bf before} the above rule: \footnotesize -\begin{verbatim} +\begin{lstlisting} 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} +\end{lstlisting} \normalsize This will ensure that any Bacula traffic will not get terminated because of high usage rates. - + \section{How do I tell the Job which Volume to use?} \item[I can't figure out how to tell the job which volume to use] \index[general]{What tape to mount} @@ -829,7 +825,7 @@ iptables -t filter -A INPUT --dport 9103 -j ACCEPT 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. + 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 @@ -839,7 +835,7 @@ iptables -t filter -A INPUT --dport 9103 -j ACCEPT 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. + 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 @@ -853,7 +849,7 @@ iptables -t filter -A INPUT --dport 9103 -j ACCEPT 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 ... + out what tape it wants, and you can mount it before you go home ... \label{Password generation} \section{Password generation} @@ -873,4 +869,4 @@ iptables -t filter -A INPUT --dport 9103 -j ACCEPT configuration files. \end{description} - + diff --git a/docs/manuals/en/problems/firewalls.tex b/docs/manuals/en/problems/firewalls.tex index 9646ea65..7d05d449 100644 --- a/docs/manuals/en/problems/firewalls.tex +++ b/docs/manuals/en/problems/firewalls.tex @@ -1,6 +1,3 @@ -%% -%% - \chapter{Dealing with Firewalls} \label{FirewallsChapter} \index[general]{Dealing with Firewalls } @@ -8,54 +5,49 @@ If you have a firewall or a DMZ installed on your computer, you may experience difficulties contacting one or more of the Clients to back them up. This is -especially true if you are trying to backup a Client across the Internet. +especially true if you are trying to backup a Client across the Internet. \section{Technical Details} \index[general]{Technical Details } \index[general]{Details!Technical } If you are attempting to do this, the sequence of network events in Bacula to -do a backup are the following: +do a backup are the following: -\footnotesize -\begin{verbatim} +\begin{lstlisting} Console -> DIR:9101 DIR -> SD:9103 DIR -> FD:9102 FD -> SD:9103 -\end{verbatim} -\normalsize +\end{lstlisting} + Where hopefully it is obvious that DIR represents the Director, FD the File daemon or client, and SD the Storage daemon. The numbers that follow those names are the standard ports used by Bacula, and the \verb:->: represents the left side making a connection to the right side (i.e. the right side is the "server" or is listening on the specified port), and the left side is the -"client" that initiates the conversation. +"client" that initiates the conversation. Note, port 9103 serves both the Director and the File daemon, each having its -own independent connection. +own independent connection. -If you are running {\bf iptables}, you might add something like: +If you are running {\bf iptables}, you might add something like: -\footnotesize -\begin{verbatim} +\begin{lstlisting} -A FW-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9101:9103 -j ACCEPT -\end{verbatim} -\normalsize +\end{lstlisting} -on your server, and +on your server, and -\footnotesize -\begin{verbatim} +\begin{lstlisting} -A FW-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9102 -j ACCEPT -\end{verbatim} -\normalsize +\end{lstlisting} on your client. In both cases, I assume that the machine is allowed to initiate connections on any port. If not, you will need to allow outgoing connections on ports 9102 and 9103 on your server and 9103 on your client. -Thanks to Raymond Norton for this tip. +Thanks to Raymond Norton for this tip. \section{A Concrete Example} \index[general]{Example!Concrete } @@ -77,114 +69,91 @@ For the sake of discussion we will refer to this network as the 'internal' network because it connects to the internet through a NAT'd firewall. We will call the network on the public (internet) side of the NAT'd firewall the 'external' network. Also, for the sake of discussion we will call my bacula -server: +server: -\footnotesize -\begin{verbatim} +\begin{lstlisting} server.int.mydomain.tld -\end{verbatim} -\normalsize +\end{lstlisting} -when a fully qualified domain name is required, or simply: +when a fully qualified domain name is required, or simply: -\footnotesize -\begin{verbatim} +\begin{lstlisting} server -\end{verbatim} -\normalsize +\end{lstlisting} if a hostname is adequate. We will call the various bacula daemons running on -the server.int.mydomain.tld machine: +the server.int.mydomain.tld machine: -\footnotesize -\begin{verbatim} +\begin{lstlisting} server-fd server-sd server-dir -\end{verbatim} -\normalsize +\end{lstlisting} In addition, I have two clients that I want to back up with Bacula. The first -client is on the internal network. Its fully qualified domain name is: +client is on the internal network. Its fully qualified domain name is: -\footnotesize -\begin{verbatim} +\begin{lstlisting} private1.int.mydomain.tld -\end{verbatim} -\normalsize +\end{lstlisting} -And its hostname is: +And its hostname is: -\footnotesize -\begin{verbatim} +\begin{lstlisting} private1 -\end{verbatim} -\normalsize +\end{lstlisting} -This machine is a client and therefore runs just one bacula daemon: +This machine is a client and therefore runs just one bacula daemon: -\footnotesize -\begin{verbatim} +\begin{lstlisting} private1-fd -\end{verbatim} -\normalsize +\end{lstlisting} The second client is on the external network. Its fully qualified domain name -is: +is: -\footnotesize -\begin{verbatim} +\begin{lstlisting} public1.mydomain.tld -\end{verbatim} -\normalsize +\end{lstlisting} -And its hostname is: +And its hostname is: -\footnotesize -\begin{verbatim} +\begin{lstlisting} public1 -\end{verbatim} -\normalsize +\end{lstlisting} -This machine also runs just one bacula daemon: +This machine also runs just one bacula daemon: -\footnotesize -\begin{verbatim} +\begin{lstlisting} public1-fd -\end{verbatim} -\normalsize +\end{lstlisting} Finally, I have a NAT firewall/gateway with two network interfaces. The first interface is on the internal network and serves as a gateway to the internet for all the machines attached to the internal network (For example, server.int.mydomain.tld and private1.int.mydomain.tld). The second interface is on the external (internet) network. The external interface has been -assigned the name: +assigned the name: -\footnotesize -\begin{verbatim} +\begin{lstlisting} firewall.mydomain.tld -\end{verbatim} -\normalsize +\end{lstlisting} -Remember: +Remember: -\footnotesize -\begin{verbatim} +\begin{lstlisting} *.int.mydomain.tld = internal network *.mydomain.tld = external network -\end{verbatim} -\normalsize +\end{lstlisting} \subsection{The Bacula Configuration Files for the Above} \index[general]{Above!Bacula Configuration Files for the } \index[general]{Bacula Configuration Files for the Above } server-sd manages a 4 tape AIT autoloader. All of my backups are written to -server-sd. I have just *one* Device resource in my server-sd.conf file: +server-sd. I have just *one* Device resource in my server-sd.conf file: -\footnotesize -\begin{verbatim} +\begin{lstlisting} Autochanger { Name = "autochanger1";\ Device = Drive0 @@ -204,16 +173,14 @@ Device { Fast Forward Space File = No BSF at EOM = yes } -\end{verbatim} -\normalsize +\end{lstlisting} -(note, please see +(note, please see \ilink{the Tape Testing}{FreeBSDTapes} chapter of this manual for important FreeBSD information.) However, unlike previously, there -is only one Storage definition in my server-dir.conf file: +is only one Storage definition in my server-dir.conf file: -\footnotesize -\begin{verbatim} +\begin{lstlisting} Storage { Name = "autochanger1" # Storage device for backing up Address = Storage-server @@ -223,8 +190,7 @@ Storage { Media Type = AIT-1 Autochanger = yes } -\end{verbatim} -\normalsize +\end{lstlisting} Note that the Storage resource uses neither of the two addresses to the Storage daemon -- neither server.int.mydomain.tld nor @@ -237,10 +203,9 @@ machine), Storage-server is resolved to firewall.mydomain.tld. In addition to the above, I have two Client resources defined in -server-dir.conf: +server-dir.conf: -\footnotesize -\begin{verbatim} +\begin{lstlisting} Client { Name = private1-fd Address = private1.int.mydomain.tld @@ -255,14 +220,12 @@ Client { Catalog = MyCatalog Password = "mysecretpassword" # password for FileDaemon } -\end{verbatim} -\normalsize +\end{lstlisting} And finally, to tie it all together, I have two Job resources defined in -server-dir.conf: +server-dir.conf: -\footnotesize -\begin{verbatim} +\begin{lstlisting} Job { Name = "Private1-Backup" Type = Backup @@ -287,8 +250,7 @@ Job { Write Bootstrap = "/var/db/bacula/Public1-Backup.bsr" Priority = 13 } -\end{verbatim} -\normalsize +\end{lstlisting} It is important to notice that because the 'Private1-Backup' Job is intended to back up a machine on the internal network so it resolves Storage-server @@ -299,47 +261,47 @@ to contact the Storage daemon via the external net. I have left the Pool, Catalog, Messages, FileSet, Schedule, and Director resources out of the above server-dir.conf examples because they are not -pertinent to the discussion. +pertinent to the discussion. \subsection{How Does It Work?} \index[general]{How Does It Work? } \index[general]{Work!How Does It } If I want to run a backup of private1.int.mydomain.tld and store that backup -using server-sd then my understanding of the order of events is this: +using server-sd then my understanding of the order of events is this: \begin{enumerate} -\item I execute my Bacula 'console' command on server.int.mydomain.tld. -\item console connects to server-dir. -\item I tell console to 'run' backup Job 'Private1-Backup'. -\item console relays this command to server-dir. -\item server-dir connects to private1-fd at private1.int.mydomain.tld:9102 +\item I execute my Bacula 'console' command on server.int.mydomain.tld. +\item console connects to server-dir. +\item I tell console to 'run' backup Job 'Private1-Backup'. +\item console relays this command to server-dir. +\item server-dir connects to private1-fd at private1.int.mydomain.tld:9102 \item server-dir tells private1-fd to start sending the files defined in the - 'Private1-Backup' Job's FileSet resource to the Storage resource - 'autochanger1', which we have defined in server-dir.conf as having the + 'Private1-Backup' Job's FileSet resource to the Storage resource + 'autochanger1', which we have defined in server-dir.conf as having the address:port of Storage-server, which is mapped by DNS to server.int.mydomain.tld. -\item private1-fd connects to server.int.mydomain.tld:9103 and begins sending - files. +\item private1-fd connects to server.int.mydomain.tld:9103 and begins sending + files. \end{enumerate} Alternatively, if I want to run a backup of public1.mydomain.tld and store that backup using server-sd then my understanding of the order of events is -this: +this: \begin{enumerate} -\item I execute my Bacula 'console' command on server.int.mydomain.tld. -\item console connects to server-dir. -\item I tell console to 'run' backup Job 'Public1-Backup'. -\item console relays this command to server-dir. -\item server-dir connects, through the NAT'd firewall, to public1-fd at - public1.mydomain.tld:9102 +\item I execute my Bacula 'console' command on server.int.mydomain.tld. +\item console connects to server-dir. +\item I tell console to 'run' backup Job 'Public1-Backup'. +\item console relays this command to server-dir. +\item server-dir connects, through the NAT'd firewall, to public1-fd at + public1.mydomain.tld:9102 \item server-dir tells public1-fd to start sending the files defined in the - 'Public1-Backup' Job's FileSet resource to the Storage resource - 'autochanger1', which we have defined in server-dir.conf as having the + 'Public1-Backup' Job's FileSet resource to the Storage resource + 'autochanger1', which we have defined in server-dir.conf as having the same address:port as above of Storage-server, but which on this machine - is resolved to firewall.mydomain.tld:9103. -\item public1-fd connects to firewall.mydomain.tld:9103 and begins sending - files. + is resolved to firewall.mydomain.tld:9103. +\item public1-fd connects to firewall.mydomain.tld:9103 and begins sending + files. \end{enumerate} \subsection{Important Note} @@ -349,7 +311,7 @@ this: In order for the above 'Public1-Backup' Job to succeed, firewall.mydomain.tld:9103 MUST be forwarded using the firewall's configuration software to server.int.mydomain.tld:9103. Some firewalls call -this 'Server Publication'. Others may call it 'Port Forwarding'. +this 'Server Publication'. Others may call it 'Port Forwarding'. \subsection{Firewall Problems} \index[general]{Firewall Problems} @@ -364,10 +326,10 @@ terminated. In that case, the first thing to try is turning on the and set an interval of say five minutes. Also, if you have denial of service rate limiting in your firewall, this -too can cause Bacula disconnects since Bacula can at times use very high +too can cause Bacula disconnects since Bacula can at times use very high access rates. To avoid this, you should implement default accept rules for the Bacula ports involved before the rate limiting rules. Finally, if you have a Windows machine, it will most likely by default -disallow connections to the Bacula Windows File daemon. See the +disallow connections to the Bacula Windows File daemon. See the Windows chapter of this manual for additional details. diff --git a/docs/manuals/en/problems/kaboom.tex b/docs/manuals/en/problems/kaboom.tex index a4e5bc57..4615bacb 100644 --- a/docs/manuals/en/problems/kaboom.tex +++ b/docs/manuals/en/problems/kaboom.tex @@ -1,6 +1,3 @@ -%% -%% - \chapter{What To Do When Bacula Crashes (Kaboom)} \label{KaboomChapter} \index[general]{Kaboom!What To Do When Bacula Crashes } @@ -10,29 +7,29 @@ If you are running on a Linux system, and you have a set of working configuration files, it is very unlikely that {\bf Bacula} will crash. As with all software, however, it is inevitable that someday, it may crash, particularly if you are running on another operating system or using a new or -unusual feature. +unusual feature. This chapter explains what you should do if one of the three {\bf Bacula} -daemons (Director, File, Storage) crashes. When we speak of crashing, we +daemons (Director, File, Storage) crashes. When we speak of crashing, we mean that the daemon terminates abnormally because of an error. There are -many cases where Bacula detects errors (such as PIPE errors) and will fail +many cases where Bacula detects errors (such as PIPE errors) and will fail a job. These are not considered crashes. In addition, under certain -conditions, Bacula will detect a fatal in the configuration, such as +conditions, Bacula will detect a fatal in the configuration, such as lack of permission to read/write the working directory. In that case, Bacula will force itself to crash with a SEGFAULT. However, before -crashing, Bacula will normally display a message indicating why. +crashing, Bacula will normally display a message indicating why. For more details, please read on. - + \section{Traceback} \index[general]{Traceback} Each of the three Bacula daemons has a built-in exception handler which, in case of an error, will attempt to produce a traceback. If successful the -traceback will be emailed to you. +traceback will be emailed to you. For this to work, you need to ensure that a few things are setup correctly on -your system: +your system: \begin{enumerate} \item You must have a version of Bacula built with debug information turned @@ -43,18 +40,18 @@ your system: gdb} may be replaced by {\bf dbx}. \item The Bacula installed script file {\bf btraceback} must be in the same - directory as the daemon which dies, and it must be marked as executable. + directory as the daemon which dies, and it must be marked as executable. \item The script file {\bf btraceback.gdb} must have the correct path to it - specified in the {\bf btraceback} file. + specified in the {\bf btraceback} file. -\item You must have a {\bf mail} program which is on {\bf Bacula's} path. +\item You must have a {\bf mail} program which is on {\bf Bacula's} path. By default, this {\bf mail} program is set to {\bf bsmtp}, so it must be correctly configured. \item If you run either the Director or Storage daemon under a non-root userid, you will most likely need to modify the {\bf btraceback} file - to do something like {\bf sudo} (raise to root priority) for the + to do something like {\bf sudo} (raise to root priority) for the call to {\bf gdb} so that it has the proper permissions to debug Bacula. \end{enumerate} @@ -64,22 +61,20 @@ traceback report and email it to you. If the above conditions are not true, you can either run the debugger by hand as described below, or you may be able to correct the problems by editing the {\bf btraceback} file. I recommend not spending too much time on trying to get the traceback to work as it can be -very difficult. +very difficult. The changes that might be needed are to add a correct path to the {\bf gdb} program, correct the path to the {\bf btraceback.gdb} file, change the {\bf mail} program or its path, or change your email address. The key line in the -{\bf btraceback} file is: +{\bf btraceback} file is: -\footnotesize -\begin{verbatim} +\begin{lstlisting} gdb -quiet -batch -x /home/kern/bacula/bin/btraceback.gdb \ $1 $2 2>\&1 | bsmtp -s "Bacula traceback" your-address@xxx.com -\end{verbatim} -\normalsize +\end{lstlisting} Since each daemon has the same traceback code, a single btraceback file is -sufficient if you are running more than one daemon on a machine. +sufficient if you are running more than one daemon on a machine. \section{Testing The Traceback} \index[general]{Traceback!Testing The } @@ -89,10 +84,9 @@ To "manually" test the traceback feature, you simply start {\bf Bacula} then obtain the {\bf PID} of the main daemon thread (there are multiple threads). The output produced here will look different depending on what OS and what version of the kernel you are running. -Unfortunately, the output had to be split to fit on this page: +Unfortunately, the output had to be split to fit on this page: -\footnotesize -\begin{verbatim} +\begin{lstlisting} [kern@rufus kern]$ ps fax --columns 132 | grep bacula-dir 2103 ? S 0:00 /home/kern/bacula/k/src/dird/bacula-dir -c /home/kern/bacula/k/src/dird/dird.conf @@ -102,23 +96,20 @@ Unfortunately, the output had to be split to fit on this page: /home/kern/bacula/k/src/dird/dird.conf 2105 ? S 0:00 \_ /home/kern/bacula/k/src/dird/bacula-dir -c /home/kern/bacula/k/src/dird/dird.conf -\end{verbatim} -\normalsize +\end{lstlisting} which in this case is 2103. Then while Bacula is running, you call the program giving it the path to the Bacula executable and the {\bf PID}. In this case, -it is: +it is: -\footnotesize -\begin{verbatim} +\begin{lstlisting} ./btraceback /home/kern/bacula/k/src/dird 2103 -\end{verbatim} -\normalsize +\end{lstlisting} It should produce an email showing you the current state of the daemon (in this case the Director), and then exit leaving {\bf Bacula} running as if nothing happened. If this is not the case, you will need to correct the -problem by modifying the {\bf btraceback} script. +problem by modifying the {\bf btraceback} script. Typical problems might be that {\bf gdb} or {\bf dbx} for Solaris is not on the default path. Fix this by specifying the full path to it in the {\bf @@ -151,63 +142,55 @@ If for some reason you cannot get the automatic traceback, or if you want to interactively examine the variable contents after a crash, you can run Bacula under the debugger. Assuming you want to run the Storage daemon under the debugger (the technique is the same for the other daemons, only the name -changes), you would do the following: +changes), you would do the following: \begin{enumerate} \item Start the Director and the File daemon. If the Storage daemon also starts, you will need to find its PID as shown above (ps fax | grep - bacula-sd) and kill it with a command like the following: + bacula-sd) and kill it with a command like the following: -\footnotesize -\begin{verbatim} +\begin{lstlisting} kill -15 PID -\end{verbatim} -\normalsize +\end{lstlisting} -where you replace {\bf PID} by the actual value. +where you replace {\bf PID} by the actual value. \item At this point, the Director and the File daemon should be running but - the Storage daemon should not. + the Storage daemon should not. -\item cd to the directory containing the Storage daemon +\item cd to the directory containing the Storage daemon -\item Start the Storage daemon under the debugger: +\item Start the Storage daemon under the debugger: - \footnotesize -\begin{verbatim} +\begin{lstlisting} gdb ./bacula-sd -\end{verbatim} -\normalsize +\end{lstlisting} -\item Run the Storage daemon: +\item Run the Storage daemon: - \footnotesize -\begin{verbatim} +\begin{lstlisting} run -s -f -c ./bacula-sd.conf -\end{verbatim} -\normalsize +\end{lstlisting} You may replace the {\bf ./bacula-sd.conf} with the full path to the Storage -daemon's configuration file. +daemon's configuration file. -\item At this point, Bacula will be fully operational. +\item At this point, Bacula will be fully operational. \item In another shell command window, start the Console program and do what - is necessary to cause Bacula to die. + is necessary to cause Bacula to die. \item When Bacula crashes, the {\bf gdb} shell window will become active and - {\bf gdb} will show you the error that occurred. + {\bf gdb} will show you the error that occurred. \item To get a general traceback of all threads, issue the following command: - -\footnotesize -\begin{verbatim} + +\begin{lstlisting} thread apply all bt -\end{verbatim} -\normalsize +\end{lstlisting} -After that you can issue any debugging command. +After that you can issue any debugging command. \end{enumerate} \section{Getting Debug Output from Bacula} @@ -217,17 +200,15 @@ disabled. There are two ways to enable the debug output. One is to add the {\bf -d nnn} option on the command line when starting the debugger. The {\bf nnn} is the debug level, and generally anything between 50 and 200 is reasonable. The higher the number, the more output is produced. The output is -written to standard output. +written to standard output. The second way of getting debug output is to dynamically turn it on using the -Console using the {\bf setdebug} command. The full syntax of the command is: +Console using the {\bf setdebug} command. The full syntax of the command is: -\footnotesize -\begin{verbatim} +\begin{lstlisting} setdebug level=nnn client=client-name storage=storage-name dir -\end{verbatim} -\normalsize +\end{lstlisting} If none of the options are given, the command will prompt you. You can selectively turn on/off debugging in any or all the daemons (i.e. it is not -necessary to specify all the components of the above command). +necessary to specify all the components of the above command). diff --git a/docs/manuals/en/problems/problems.tex b/docs/manuals/en/problems/problems.tex index 08b33035..a73416a0 100644 --- a/docs/manuals/en/problems/problems.tex +++ b/docs/manuals/en/problems/problems.tex @@ -5,16 +5,30 @@ %% %% # $ % & ~ _ ^ \ { } %% +\documentclass[10pt,bsyspaper,english,logo,titlepage]{bsysmanual} + +\renewcommand{\familydefault}{\sfdefault} +\usepackage[utf8]{inputenc} +\usepackage[toc,title,header,page]{appendix} +\usepackage[T1]{fontenc} +\usepackage{longtable,graphicx,fancyhdr,lastpage,eurosym,dcolumn,ltxtable} +\usepackage{textcomp,varioref,lscape,pdfpages,ifthen,setspace,colortbl,diagbox} +\usepackage{lmodern,minitoc} +\usepackage{MnSymbol} +\usepackage{bbding,multirow} +\usepackage[hyphens]{url} +\usepackage[plainpages=true,bookmarks=false,bookmarksopen=false,filecolor=black,linkcolor=black,urlcolor=bsysredtwo,filebordercolor={0. 0. 0.},menubordercolor={0. 0. 0.},urlbordercolor={0. 0. 0.},linkbordercolor={0. 0. 0.},hyperindex=false,colorlinks=true]{hyperref} +\usepackage{babel,xr,xr-hyper} +\usepackage[font={sf,bf},textfont=md]{caption} +\usepackage[printonlyused]{acronym} +\setlength\arrayrulewidth{0.4pt} +\include{bsyscommondefs} +\usepackage[left=4cm,right=3cm,bottom=2cm,top=2.5cm]{geometry} +\usepackage{moreverb,fancyvrb} +\usepackage{listings} +\input{external-references} +\pdfminorversion=4 -\documentclass[10pt,a4paper]{book} - -\topmargin -0.5in -\oddsidemargin 0.0in -\evensidemargin 0.0in -\textheight 10in -\textwidth 6.5in - -\usepackage{html} \usepackage{float} \usepackage{graphicx} \usepackage{bacula} @@ -22,62 +36,40 @@ \usepackage{makeidx} \usepackage{index} \usepackage{setspace} -\usepackage{hyperref} \usepackage{url} - \makeindex \newindex{general}{idx}{ind}{General Index} \sloppy +\def\bsystitle{Problem Resolution Guide} \begin{document} +\lstset{escapechar=,breaklines=true,basicstyle=\ttfamily\scriptsize,backgroundcolor=\color{lightbsysgrey}} \sloppy +\include{coverpage} -\newfont{\bighead}{cmr17 at 36pt} -\parskip 10pt -\parindent 0pt - -\title{\includegraphics{\idir bacula-logo.eps} \\ \bigskip - \Huge{Bacula Problem Resolution Guide} - \begin{center} - \large{The Leading Open Source Backup Solution. } - \end{center} -} - - -\author{Kern Sibbald} -\date{\vspace{1.0in}\today \\ - This manual documents Bacula version \input{version} \\ - \vspace{0.2in} - Copyright \copyright 1999-2010, Free Software Foundation Europe - e.V. \\ - \vspace{0.2in} - Permission is granted to copy, distribute and/or modify this document under the terms of the - GNU Free Documentation License, Version 1.2 published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. - A copy of the license is included in the section entitled "GNU Free Documentation License". -} - -\maketitle - -\clearpage +\frontmatter \tableofcontents -\clearpage +\listoftables +\listoffigures +\mainmatter \include{faq} \include{tips} \include{tapetesting} \include{firewalls} \include{kaboom} +\begin{appendices} +\begin{small} \include{fdl} - +\end{small} +\end{appendices} % The following line tells link_resolver.pl to not include these files: % nolinks developersi baculai-dir baculai-fd baculai-sd baculai-console baculai-main % pull in the index -\clearpage \printindex[general] \end{document} diff --git a/docs/manuals/en/problems/problemsi-console.tex b/docs/manuals/en/problems/problemsi-console.tex new file mode 100644 index 00000000..e69de29b diff --git a/docs/manuals/en/problems/problemsi-dir.tex b/docs/manuals/en/problems/problemsi-dir.tex new file mode 100644 index 00000000..e69de29b diff --git a/docs/manuals/en/problems/problemsi-fd.tex b/docs/manuals/en/problems/problemsi-fd.tex new file mode 100644 index 00000000..e69de29b diff --git a/docs/manuals/en/problems/problemsi-general.tex b/docs/manuals/en/problems/problemsi-general.tex new file mode 100644 index 00000000..e69de29b diff --git a/docs/manuals/en/problems/problemsi-sd.tex b/docs/manuals/en/problems/problemsi-sd.tex new file mode 100644 index 00000000..e69de29b diff --git a/docs/manuals/en/problems/tapetesting.tex b/docs/manuals/en/problems/tapetesting.tex index 710f90e7..6cca9b6c 100644 --- a/docs/manuals/en/problems/tapetesting.tex +++ b/docs/manuals/en/problems/tapetesting.tex @@ -1,12 +1,9 @@ -%% -%% - \chapter{Testing Your Tape Drive With Bacula} \label{TapeTestingChapter} \index[general]{Testing Your Tape Drive With Bacula} This chapter is concerned with testing and configuring your tape drive to make -sure that it will work properly with Bacula using the {\bf btape} program. +sure that it will work properly with Bacula using the {\bf btape} program. \label{summary} \section{Get Your Tape Drive Working} @@ -14,61 +11,61 @@ sure that it will work properly with Bacula using the {\bf btape} program. In general, you should follow the following steps to get your tape drive to work with Bacula. Start with a tape mounted in your drive. If you have an autochanger, load a tape into the drive. We use {\bf /dev/nst0} as the tape -drive name, you will need to adapt it according to your system. +drive name, you will need to adapt it according to your system. Do not proceed to the next item until you have succeeded with the previous -one. +one. \begin{enumerate} \item Make sure that Bacula (the Storage daemon) is not running - or that you have {\bf unmount}ed the drive you will use + or that you have {\bf unmount}ed the drive you will use for testing. -\item Use tar to write to, then read from your drive: +\item Use tar to write to, then read from your drive: \footnotesize -\begin{verbatim} +\begin{lstlisting} mt -f /dev/nst0 rewind tar cvf /dev/nst0 . mt -f /dev/nst0 rewind tar tvf /dev/nst0 - -\end{verbatim} + +\end{lstlisting} \normalsize \item Make sure you have a valid and correct Device resource corresponding to your drive. For Linux users, generally, the default one works. For FreeBSD users, there are two possible Device configurations (see below). For other drives and/or OSes, you will need to first ensure that your - system tape modes are properly setup (see below), then possibly modify + system tape modes are properly setup (see below), then possibly modify you Device resource depending on the output from the btape program (next - item). When doing this, you should consult the \ilink{Storage Daemon - Configuration}{StoredConfChapter} of this manual. + item). When doing this, you should consult the \bsysxrlink{Storage Daemon + Configuration}{StoredConfChapter}{main}{chapter} of the \mainman{}. \item If you are using a Fibre Channel to connect your tape drive to Bacula, please be sure to disable any caching in the NSR (network storage router, which is a Fibre Channel to SCSI converter). -\item Run the btape {\bf test} command: +\item Run the btape {\bf test} command: \footnotesize -\begin{verbatim} +\begin{lstlisting} ./btape -c bacula-sd.conf /dev/nst0 test - -\end{verbatim} + +\end{lstlisting} \normalsize It isn't necessary to run the autochanger part of the test at this time, but do not go past this point until the basic test succeeds. If you do - have an autochanger, please be sure to read the \ilink{Autochanger - chapter}{AutochangersChapter} of this manual. + have an autochanger, please be sure to read the \bsysxrlink{Autochanger + chapter}{AutochangersChapter}{main}{chapter} of the \mainman{}. \item Run the btape {\bf fill} command, preferably with two volumes. This can take a long time. If you have an autochanger and it is configured, Bacula will automatically use it. If you do not have it configured, you can manually issue the appropriate {\bf mtx} command, or press the autochanger buttons to - change the tape when requested to do so. + change the tape when requested to do so. \item FreeBSD users, if you have a pre-5.0 system run the {\bf tapetest} program, and make sure your system is patched if necessary. The tapetest @@ -82,15 +79,15 @@ one. directory. Then stop and restart Bacula. \item Do a restore of the directory backed up, by entering the following - restore command, being careful to restore it to an alternate location: + restore command, being careful to restore it to an alternate location: \footnotesize -\begin{verbatim} +\begin{lstlisting} restore select all done yes - -\end{verbatim} + +\end{lstlisting} \normalsize Do a {\bf diff} on the restored directory to ensure it is identical to the @@ -99,19 +96,19 @@ one. on each system type. \item If you have an autochanger, you should now go back to the btape program - and run the autochanger test: + and run the autochanger test: \footnotesize -\begin{verbatim} +\begin{lstlisting} ./btape -c bacula-sd.conf /dev/nst0 auto - -\end{verbatim} + +\end{lstlisting} \normalsize Adjust your autochanger as necessary to ensure that it works correctly. See the Autochanger chapter of this manual for a complete discussion of testing - your autochanger. + your autochanger. \item We strongly recommend that you use a dedicated SCSI controller for your tape drives. Scanners are known to induce @@ -122,10 +119,10 @@ one. the following was most likely caused by a scanner: \footnotesize -\begin{verbatim} +\begin{lstlisting} Feb 14 17:29:55 epohost kernel: (scsi0:A:2:0): No or incomplete CDB sent to device. Feb 14 17:29:55 epohost kernel: scsi0: Issued Channel A Bus Reset. 1 SCBs aborted -\end{verbatim} +\end{lstlisting} \normalsize \end{enumerate} @@ -134,8 +131,8 @@ If you have reached this point, you stand a good chance of having everything work. If you get into trouble at any point, {\bf carefully} read the documentation given below. If you cannot get past some point, ask the {\bf bacula-users} email list, but specify which of the steps you have successfully -completed. In particular, you may want to look at the -\ilink{ Tips for Resolving Problems}{problems1} section below. +completed. In particular, you may want to look at the +\ilink{Tips for Resolving Problems}{problems1} section below. \label{NoTapeInDrive} @@ -176,7 +173,7 @@ configuration parameters for your archive device (generally a tape drive). Without those parameters, the testing and utility programs do not know how to properly read and write your drive. By default, they use {\bf bacula-sd.conf} in the current directory, but you may specify a different configuration file -using the {\bf -c} option. +using the {\bf -c} option. \subsection{Specifying a Device Name For a Tape} \index[general]{Tape!Specifying a Device Name For a} @@ -188,7 +185,7 @@ tape, this is the physical device name such as {\bf /dev/nst0} or {\bf directive. For the program to work, it must find the identical name in the Device resource of the configuration file. If the name is not found in the list of physical names, the utility program will compare the name you entered -to the Device names (rather than the Archive device names). +to the Device names (rather than the Archive device names). When specifying a tape device, it is preferable that the "non-rewind" variant of the device file name be given. In addition, on systems such as @@ -198,7 +195,7 @@ to use Berkeley I/O conventions with the device. The what is needed in this case. Bacula does not support SysV tape drive behavior. -See below for specifying Volume names. +See below for specifying Volume names. \subsection{Specifying a Device Name For a File} \index[general]{File!Specifying a Device Name For a} @@ -220,24 +217,24 @@ This program permits a number of elementary tape operations via a tty command interface. The {\bf test} command, described below, can be very useful for testing tape drive compatibility problems. Aside from initial testing of tape drive compatibility with {\bf Bacula}, {\bf btape} will be mostly used by -developers writing new tape drivers. +developers writing new tape drivers. {\bf btape} can be dangerous to use with existing {\bf Bacula} tapes because it will relabel a tape or write on the tape if so requested regardless of whether or not the tape contains valuable data, so please be careful and use -it only on blank tapes. +it only on blank tapes. To work properly, {\bf btape} needs to read the Storage daemon's configuration file. As a default, it will look for {\bf bacula-sd.conf} in the current directory. If your configuration file is elsewhere, please use the {\bf -c} -option to specify where. +option to specify where. The physical device name or the Device resource name must be specified on the command line, and this same device name must be present in the Storage -daemon's configuration file read by {\bf btape} +daemon's configuration file read by {\bf btape} \footnotesize -\begin{verbatim} +\begin{lstlisting} Usage: btape [options] device_name -b specify bootstrap file -c set configuration file to file @@ -246,7 +243,7 @@ Usage: btape [options] device_name -s turn off signals -v be verbose -? print this message. -\end{verbatim} +\end{lstlisting} \normalsize \subsection{Using btape to Verify your Tape Drive} @@ -255,44 +252,44 @@ Usage: btape [options] device_name An important reason for this program is to ensure that a Storage daemon configuration file is defined so that Bacula will correctly read and write -tapes. +tapes. It is highly recommended that you run the {\bf test} command before running your first Bacula job to ensure that the parameters you have defined for your storage device (tape drive) will permit {\bf Bacula} to function properly. You only need to mount a blank tape, enter the command, and the output should be -reasonably self explanatory. For example: +reasonably self explanatory. For example: \footnotesize -\begin{verbatim} +\begin{lstlisting} (ensure that Bacula is not running) ./btape -c /usr/bin/bacula/bacula-sd.conf /dev/nst0 -\end{verbatim} +\end{lstlisting} \normalsize -The output will be: +The output will be: \footnotesize -\begin{verbatim} +\begin{lstlisting} Tape block granularity is 1024 bytes. btape: btape.c:376 Using device: /dev/nst0 * -\end{verbatim} +\end{lstlisting} \normalsize -Enter the test command: +Enter the test command: \footnotesize -\begin{verbatim} +\begin{lstlisting} test -\end{verbatim} +\end{lstlisting} \normalsize The output produced should be something similar to the following: I've cut the -listing short because it is frequently updated to have new tests. +listing short because it is frequently updated to have new tests. \footnotesize -\begin{verbatim} +\begin{lstlisting} === Append files test === This test is essential to Bacula. I'm going to write one record in file 0, @@ -321,25 +318,25 @@ We should be in file 3. I am at file 3. This is correct! Now the important part, I am going to attempt to append to the tape. ... === End Append files test === -\end{verbatim} +\end{lstlisting} \normalsize If you do not successfully complete the above test, please resolve the problem(s) before attempting to use {\bf Bacula}. Depending on your tape drive, the test may recommend that you add certain records to your configuration. We strongly recommend that you do so and then re-run the above -test to insure it works the first time. +test to insure it works the first time. Some of the suggestions it provides for resolving the problems may or may not be useful. If at all possible avoid using fixed blocking. If the test suddenly -starts to print a long series of: +starts to print a long series of: \footnotesize -\begin{verbatim} +\begin{lstlisting} Got EOF on tape. Got EOF on tape. ... -\end{verbatim} +\end{lstlisting} \normalsize then almost certainly, you are running your drive in fixed block mode rather @@ -351,7 +348,7 @@ set in SysV tape drive mode. The drive must use BSD tape conventions. See the section above on setting your {\bf Archive device} correctly. For FreeBSD users, please see the notes below for doing further testing of -your tape drive. +your tape drive. \subsection{Testing tape drive speed} \label{sec:btapespeed} @@ -374,7 +371,7 @@ This command can have the following arguments: access. \end{itemize} -\begin{verbatim} +\begin{lstlisting} *speed file_size=3 skip_raw btape.c:1078 Test with zero data and bacula block structure. btape.c:956 Begin writing 3 files of 3.221 GB with blocks of 129024 bytes. @@ -393,7 +390,7 @@ btape.c:406 Volume bytes=3.221 GB. Write rate = 7.271 MB/s ... btape.c:383 Total Volume bytes=9.664 GB. Total Write rate = 7.365 MB/s -\end{verbatim} +\end{lstlisting} When using compression, the random test will give your the minimum throughput of your drive . The test using constant string will give you the maximum speed @@ -406,25 +403,25 @@ You can change the block size in the Storage Daemon configuration file. \index[general]{Tricks!Linux SCSI} \index[general]{Linux SCSI Tricks} -You can find out what SCSI devices you have by doing: +You can find out what SCSI devices you have by doing: \footnotesize -\begin{verbatim} +\begin{lstlisting} lsscsi -\end{verbatim} +\end{lstlisting} \normalsize Typical output is: \footnotesize -\begin{verbatim} +\begin{lstlisting} [0:0:0:0] disk ATA ST3160812AS 3.AD /dev/sda [2:0:4:0] tape HP Ultrium 2-SCSI F6CH /dev/st0 [2:0:5:0] tape HP Ultrium 2-SCSI F6CH /dev/st1 [2:0:6:0] mediumx OVERLAND LXB 0107 - [2:0:9:0] tape HP Ultrium 1-SCSI E50H /dev/st2 [2:0:10:0] mediumx OVERLAND LXB 0107 - -\end{verbatim} +\end{lstlisting} \normalsize There are two drives in one autochanger: /dev/st0 and /dev/st1 @@ -441,16 +438,16 @@ If you do not have the {\bf lsscsi} command, you can obtain the same information as follows: \footnotesize -\begin{verbatim} +\begin{lstlisting} cat /proc/scsi/scsi -\end{verbatim} +\end{lstlisting} \normalsize For the above example with the three drives and two autochangers, I get: -\footnotesize -\begin{verbatim} +\footnotesize +\begin{lstlisting} Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: ST3160812AS Rev: 3.AD @@ -470,7 +467,7 @@ Host: scsi2 Channel: 00 Id: 09 Lun: 00 Host: scsi2 Channel: 00 Id: 10 Lun: 00 Vendor: OVERLAND Model: LXB Rev: 0107 Type: Medium Changer ANSI SCSI revision: 02 -\end{verbatim} +\end{lstlisting} \normalsize @@ -478,7 +475,7 @@ As an additional example, I get the following (on a different machine from the above example): \footnotesize -\begin{verbatim} +\begin{lstlisting} Attached devices: Host: scsi2 Channel: 00 Id: 01 Lun: 00 Vendor: HP Model: C5713A Rev: H107 @@ -486,45 +483,45 @@ Host: scsi2 Channel: 00 Id: 01 Lun: 00 Host: scsi2 Channel: 00 Id: 04 Lun: 00 Vendor: SONY Model: SDT-10000 Rev: 0110 Type: Sequential-Access ANSI SCSI revision: 02 -\end{verbatim} +\end{lstlisting} \normalsize The above represents first an autochanger and second a simple tape drive. The HP changer (the first entry) uses the same SCSI channel -for data and for control, so in Bacula, you would use: +for data and for control, so in Bacula, you would use: \footnotesize -\begin{verbatim} +\begin{lstlisting} Archive Device = /dev/nst0 Changer Device = /dev/sg0 -\end{verbatim} +\end{lstlisting} \normalsize -If you want to remove the SDT-10000 device, you can do so as root with: +If you want to remove the SDT-10000 device, you can do so as root with: \footnotesize -\begin{verbatim} +\begin{lstlisting} echo "scsi remove-single-device 2 0 4 0">/proc/scsi/scsi -\end{verbatim} +\end{lstlisting} \normalsize -and you can put add it back with: +and you can put add it back with: \footnotesize -\begin{verbatim} +\begin{lstlisting} echo "scsi add-single-device 2 0 4 0">/proc/scsi/scsi -\end{verbatim} +\end{lstlisting} \normalsize where the 2 0 4 0 are the Host, Channel, Id, and Lun as seen on the output from {\bf cat /proc/scsi/scsi}. Note, the Channel must be specified as -numeric. +numeric. Below is a slightly more complicated output, which is a single autochanger with two drives, and which operates the changer on a different channel from from the drives: \footnotesize -\begin{verbatim} +\begin{lstlisting} Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD1600JD-75H Rev: 08.0 @@ -538,7 +535,7 @@ Host: scsi2 Channel: 00 Id: 05 Lun: 00 Host: scsi2 Channel: 00 Id: 06 Lun: 00 Vendor: OVERLAND Model: LXB Rev: 0106 Type: Medium Changer ANSI SCSI revision: 02 -\end{verbatim} +\end{lstlisting} \normalsize The above tape drives are accessed on /dev/nst0 and /dev/nst1, while @@ -556,32 +553,32 @@ the control channel for those two drives is /dev/sg3. \index[general]{Files!Bacula Saves But Cannot Restore} \index[general]{Bacula Saves But Cannot Restore Files} -If you are getting error messages such as: +If you are getting error messages such as: \footnotesize -\begin{verbatim} +\begin{lstlisting} Volume data error at 0:1! Wanted block-id: "BB02", got "". Buffer discarded -\end{verbatim} +\end{lstlisting} \normalsize It is very likely that Bacula has tried to do block positioning and ended up at an invalid block. This can happen if your tape drive is in fixed block mode while Bacula's default is variable blocks. Note that in such cases, Bacula is perfectly able to write to your Volumes (tapes), but cannot position to read -them. +them. -There are two possible solutions. +There are two possible solutions. \begin{enumerate} \item The first and best is to always ensure that your drive is in variable block mode. Note, it can switch back to fixed block mode on a reboot or if another program uses the drive. So on such systems you need to modify the - Bacula startup files to explicitly set: + Bacula startup files to explicitly set: \footnotesize -\begin{verbatim} +\begin{lstlisting} mt -f /dev/nst0 defblksize 0 -\end{verbatim} +\end{lstlisting} \normalsize or whatever is appropriate on your system. Note, if you are running a Linux @@ -591,29 +588,29 @@ have not loaded the appropriate {\bf mt} package, which is often called \item The second possibility, especially, if Bacula wrote while the drive was in fixed block mode, is to turn off block positioning in Bacula. This is done - by adding: + by adding: \footnotesize -\begin{verbatim} +\begin{lstlisting} Block Positioning = no -\end{verbatim} +\end{lstlisting} \normalsize to the Device resource. This is not the recommended procedure because it can -enormously slow down recovery of files, but it may help where all else +enormously slow down recovery of files, but it may help where all else fails. This directive is available in version 1.35.5 or later (and not yet -tested). +tested). \end{enumerate} If you are getting error messages such as: \footnotesize -\begin{verbatim} +\begin{lstlisting} Volume data error at 0:0! Block checksum mismatch in block=0 len=32625 calc=345678 blk=123456 -\end{verbatim} +\end{lstlisting} \normalsize -You are getting tape read errors, and this is most likely due to +You are getting tape read errors, and this is most likely due to one of the following things: \begin{enumerate} \item An old or bad tape. @@ -632,17 +629,17 @@ one of the following things: \index[general]{Device!Bacula Cannot Open the} \index[general]{Bacula Cannot Open the Device} -If you get an error message such as: +If you get an error message such as: \footnotesize -\begin{verbatim} +\begin{lstlisting} dev open failed: dev.c:265 stored: unable to open device /dev/nst0:> ERR=No such device or address -\end{verbatim} +\end{lstlisting} \normalsize the first time you run a job, it is most likely due to the fact that you -specified the incorrect device name on your {\bf Archive Device}. +specified the incorrect device name on your {\bf Archive Device}. If Bacula works fine with your drive, then all off a sudden you get error messages similar to the one shown above, it is quite possible that your driver @@ -650,7 +647,7 @@ module is being removed because the kernel deems it idle. This is done via {\bf crontab} with the use of {\bf rmmod -a}. To fix the problem, you can remove this entry from {\bf crontab}, or you can manually {\bf modprob} your driver module (or add it to the local startup script). Thanks to Alan Brown -for this tip. +for this tip. \label{IncorrectFiles} \subsection{Incorrect File Number} @@ -664,25 +661,25 @@ tape drivers will use a fast means of seeking to the end of the medium and in doing so, they will not know the current file position and hence return a {\bf -1}. As a consequence, if you get {\bf "This is NOT correct!"} in the positioning tests, this may be the cause. You must correct this condition in -order for Bacula to work. +order for Bacula to work. There are two possible solutions to the above problem of incorrect file -number: +number: \begin{itemize} \item Figure out how to configure your SCSI driver to keep track of the file - position during the MTEOM request. This is the preferred solution. + position during the MTEOM request. This is the preferred solution. \item Modify the {\bf Device} resource of your {\bf bacula-sd.conf} file to - include: + include: \footnotesize -\begin{verbatim} +\begin{lstlisting} Hardware End of File = no -\end{verbatim} +\end{lstlisting} \normalsize This will cause Bacula to use the MTFSF request to seek to the end of the -medium, and Bacula will keep track of the file number itself. +medium, and Bacula will keep track of the file number itself. \end{itemize} \label{IncorrectBlocks} @@ -693,23 +690,23 @@ medium, and Bacula will keep track of the file number itself. {\bf Bacula's} preferred method of working with tape drives (sequential devices) is to run in variable block mode, and this is what is set by default. You should first ensure that your tape drive is set for variable block mode -(see below). +(see below). If your tape drive is in fixed block mode and you have told Bacula to use different fixed block sizes or variable block sizes (default), you will get errors when Bacula attempts to forward space to the correct block (the kernel -driver's idea of tape blocks will not correspond to Bacula's). +driver's idea of tape blocks will not correspond to Bacula's). All modern tape drives support variable tape blocks, but some older drives (in particular the QIC drives) as well as the ATAPI ide-scsi driver run only in fixed block mode. The Travan tape drives also apparently must run in fixed -block mode (to be confirmed). +block mode (to be confirmed). Even in variable block mode, with the exception of the first record on the second or subsequent volume of a multi-volume backup, Bacula will write blocks of a fixed size. However, in reading a tape, Bacula will assume that for each read request, exactly one block from the tape will be transferred. This the -most common way that tape drives work and is well supported by {\bf Bacula}. +most common way that tape drives work and is well supported by {\bf Bacula}. Drives that run in fixed block mode can cause serious problems for Bacula if the drive's block size does not correspond exactly to {\bf Bacula's} block @@ -719,28 +716,28 @@ this destroys the concept of tape blocks. It is much better to run in variable block mode, and almost all modern drives (the OnStream is an exception) run in variable block mode. In order for Bacula to run in fixed block mode, you must include the following records in the Storage daemon's Device resource -definition: +definition: \footnotesize -\begin{verbatim} +\begin{lstlisting} Minimum Block Size = nnn Maximum Block Size = nnn -\end{verbatim} +\end{lstlisting} \normalsize where {\bf nnn} must be the same for both records and must be identical to the -driver's fixed block size. +driver's fixed block size. We recommend that you avoid this configuration if at all possible by using -variable block sizes. +variable block sizes. If you must run with fixed size blocks, make sure they are not 512 bytes. This is too small and the overhead that Bacula has with each record will become excessive. If at all possible set any fixed block size to something like 64,512 bytes or possibly 32,768 if 64,512 is too large for your drive. See -below for the details on checking and setting the default drive block size. +below for the details on checking and setting the default drive block size. -To recover files from tapes written in fixed block mode, see below. +To recover files from tapes written in fixed block mode, see below. \label{TapeModes} \subsection{Ensuring that the Tape Modes Are Properly Set -- {\bf Linux @@ -753,14 +750,14 @@ of your SCSI driver's options to non-default values. For example, if your driver is set to work in SysV manner, Bacula will not work correctly because it expects BSD behavior. To reset your tape drive to the default values, you can try the following, but {\bf ONLY} if you have a SCSI tape drive on a {\bf -Linux} system: +Linux} system: \footnotesize -\begin{verbatim} +\begin{lstlisting} become super user mt -f /dev/nst0 rewind mt -f /dev/nst0 stoptions buffer-writes async-writes read-ahead -\end{verbatim} +\end{lstlisting} \normalsize The above commands will clear all options and then set those specified. None @@ -769,17 +766,17 @@ such as SysV behavior must not be set. Bacula does not support SysV tape behavior. On systems other than Linux, you will need to consult your {\bf mt} man pages or documentation to figure out how to do the same thing. This should not really be necessary though -- for example, on both Linux and Solaris -systems, the default tape driver options are compatible with Bacula. +systems, the default tape driver options are compatible with Bacula. On Solaris systems, you must take care to specify the correct device name on the {\bf Archive device} directive. See above for more details. You may also want to ensure that no prior program has set the default block -size, as happened to one user, by explicitly turning it off with: +size, as happened to one user, by explicitly turning it off with: \footnotesize -\begin{verbatim} +\begin{lstlisting} mt -f /dev/nst0 defblksize 0 -\end{verbatim} +\end{lstlisting} \normalsize If you are running a Linux @@ -789,37 +786,37 @@ have not loaded the appropriate {\bf mt} package, which is often called If you would like to know what options you have set before making any of the changes noted above, you can now view them on Linux systems, thanks to a tip -provided by Willem Riede. Do the following: +provided by Willem Riede. Do the following: \footnotesize -\begin{verbatim} +\begin{lstlisting} become super user mt -f /dev/nst0 stsetoptions 0 grep st0 /var/log/messages -\end{verbatim} +\end{lstlisting} \normalsize -and you will get output that looks something like the following: +and you will get output that looks something like the following: \footnotesize -\begin{verbatim} +\begin{lstlisting} kernel: st0: Mode 0 options: buffer writes: 1, async writes: 1, read ahead: 1 kernel: st0: can bsr: 0, two FMs: 0, fast mteom: 0, auto lock: 0, kernel: st0: defs for wr: 0, no block limits: 0, partitions: 0, s2 log: 0 kernel: st0: sysv: 0 nowait: 0 -\end{verbatim} +\end{lstlisting} \normalsize Note, I have chopped off the beginning of the line with the date and machine -name for presentation purposes. +name for presentation purposes. Some people find that the above settings only last until the next reboot, so -please check this otherwise you may have unexpected problems. +please check this otherwise you may have unexpected problems. Beginning with Bacula version 1.35.8, if Bacula detects that you are running in variable block mode, it will attempt to set your drive appropriately. All OSes permit setting variable block mode, but some OSes do not permit setting -the other modes that Bacula needs to function properly. +the other modes that Bacula needs to function properly. \label{compression} \subsection{Tape Hardware Compression and Blocking Size} @@ -827,31 +824,31 @@ the other modes that Bacula needs to function properly. \index[general]{Size!Tape Hardware Compression and Blocking Size} You should be able to verify the tape compression status with sysfs on Linux. -\begin{verbatim} +\begin{lstlisting} cat /sys/class/scsi_tape/nst0/default_compression -\end{verbatim} +\end{lstlisting} -You can, turn it on by using (on Linux): +You can, turn it on by using (on Linux): \footnotesize -\begin{verbatim} +\begin{lstlisting} become super user mt -f /dev/nst0 defcompression 1 -\end{verbatim} +\end{lstlisting} \normalsize and of course, if you use a zero instead of the one at the end, you will turn -it off. +it off. If you have built the {\bf mtx} program in the {\bf depkgs} package, you can use tapeinfo to get quite a bit of information about your tape drive even if it is not an autochanger. This program is called using the SCSI control device. On Linux for tape drive /dev/nst0, this is usually /dev/sg0, while on FreeBSD for /dev/nsa0, the control device is often /dev/pass2. For example on -my DDS-4 drive (/dev/nst0), I get the following: +my DDS-4 drive (/dev/nst0), I get the following: \footnotesize -\begin{verbatim} +\begin{lstlisting} tapeinfo -f /dev/sg0 Product Type: Tape Drive Vendor ID: 'HP ' @@ -866,8 +863,8 @@ Ready: yes BufferedMode: yes Medium Type: Not Loaded Density Code: 0x26 -BlockSize: 0 -\end{verbatim} +BlockSize: 0 +\end{lstlisting} \normalsize where the {\bf DataCompEnabled: yes} means that tape hardware compression is @@ -878,7 +875,7 @@ work in such a situation because it will normally attempt to write blocks of 64,512 bytes, except the last block of the job which will generally be shorter. The first thing to try is setting the default block size to zero using the {\bf mt -f /dev/nst0 defblksize 0} command as shown above. -On FreeBSD, this would be something like: {\bf mt -f /dev/nsa0 blocksize 0}. +On FreeBSD, this would be something like: {\bf mt -f /dev/nsa0 blocksize 0}. On some operating systems with some tape drives, the amount of data that can be written to the tape and whether or not compression is enabled is @@ -888,25 +885,25 @@ density code that is used with the drive. Most systems, but unfortunately not all, set the density to the maximum by default. On some systems, you can also get a list of all available density codes with: {\bf mt -f /dev/nst0 densities} or a similar {\bf mt} command. -Note, for DLT and SDLT devices, no-compression versus compression is very +Note, for DLT and SDLT devices, no-compression versus compression is very often controlled by the density code. On FreeBSD systems, the compression mode is set using {\bf mt -f /dev/nsa0 comp xxx} where xxx is the mode you want. In general, see {\bf man mt} for the options available on your system. Note, some of the above {\bf mt} commands may not be persistent depending -on your system configuration. That is they may be reset if a program +on your system configuration. That is they may be reset if a program other than Bacula uses the drive or, as is frequently the case, on reboot of your system. - + If your tape drive requires fixed block sizes (very unusual), you can use the -following records: +following records: \footnotesize -\begin{verbatim} +\begin{lstlisting} Minimum Block Size = nnn Maximum Block Size = nnn -\end{verbatim} +\end{lstlisting} \normalsize in your Storage daemon's Device resource to force Bacula to write fixed size @@ -915,13 +912,13 @@ should be done only if your drive does not support variable block sizes, or you have some other strong reasons for using fixed block sizes. As mentioned above, a small fixed block size of 512 or 1024 bytes will be very inefficient. Try to set any fixed block size to something like 64,512 bytes or larger if -your drive will support it. +your drive will support it. Also, note that the {\bf Medium Type} field of the output of {\bf tapeinfo} reports {\bf Not Loaded}, which is not correct. As a consequence, you should -ignore that field as well as the {\bf Attached Changer} field. +ignore that field as well as the {\bf Attached Changer} field. -To recover files from tapes written in fixed block mode, see below. +To recover files from tapes written in fixed block mode, see below. \label{FreeBSDTapes} \subsection{Tape Modes on FreeBSD} @@ -929,44 +926,44 @@ To recover files from tapes written in fixed block mode, see below. \index[general]{Tape Modes on FreeBSD} On most FreeBSD systems such as 4.9 and most tape drives, Bacula should run -with: +with: \footnotesize -\begin{verbatim} +\begin{lstlisting} mt -f /dev/nsa0 seteotmodel 2 mt -f /dev/nsa0 blocksize 0 mt -f /dev/nsa0 comp enable -\end{verbatim} +\end{lstlisting} \normalsize You might want to put those commands in a startup script to make sure your tape driver is properly initialized before running Bacula, because -depending on your system configuration, these modes may be reset if a +depending on your system configuration, these modes may be reset if a program other than Bacula uses the drive or when your system is rebooted. Then according to what the {\bf btape test} command returns, you will probably -need to set the following (see below for an alternative): +need to set the following (see below for an alternative): \footnotesize -\begin{verbatim} +\begin{lstlisting} Hardware End of Medium = no BSF at EOM = yes Backward Space Record = no Backward Space File = no Fast Forward Space File = no TWO EOF = yes -\end{verbatim} +\end{lstlisting} \normalsize Then be sure to run some append tests with Bacula where you start and stop Bacula between appending to the tape, or use {\bf btape} version 1.35.1 or -greater, which includes simulation of stopping/restarting Bacula. +greater, which includes simulation of stopping/restarting Bacula. Please see the file {\bf platforms/freebsd/pthreads-fix.txt} in the main Bacula directory concerning {\bf important} information concerning compatibility of Bacula and your system. A much more optimal Device configuration is shown below, but does not work with all tape drives. Please -test carefully before putting either into production. +test carefully before putting either into production. Note, for FreeBSD 4.10-RELEASE, using a Sony TSL11000 L100 DDS4 with an autochanger set to variable block size and DCLZ compression, Brian McDonald @@ -974,43 +971,43 @@ reports that to get Bacula to append correctly between Bacula executions, the correct values to use are: \footnotesize -\begin{verbatim} +\begin{lstlisting} mt -f /dev/nsa0 seteotmodel 1 mt -f /dev/nsa0 blocksize 0 mt -f /dev/nsa0 comp enable -\end{verbatim} +\end{lstlisting} \normalsize -and +and \footnotesize -\begin{verbatim} +\begin{lstlisting} Hardware End of Medium = no BSF at EOM = no Backward Space Record = no Backward Space File = no Fast Forward Space File = yes TWO EOF = no -\end{verbatim} +\end{lstlisting} \normalsize This has been confirmed by several other people using different hardware. This configuration is the preferred one because it uses one EOF and no backspacing at the end of the tape, which works much more efficiently and reliably with -modern tape drives. +modern tape drives. Finally, here is a Device configuration that Danny Butroyd reports to work correctly with the Overland Powerloader tape library using LT0-2 and FreeBSD 5.4-Stable: \footnotesize -\begin{verbatim} +\begin{lstlisting} # Overland Powerloader LT02 - 17 slots single drive Device { Name = Powerloader Media Type = LT0-2 Archive Device = /dev/nsa0 - AutomaticMount = yes; + AutomaticMount = yes; AlwaysOpen = yes; RemovableMedia = yes; RandomAccess = no; @@ -1032,7 +1029,7 @@ The following Device resource works fine with Dell PowerVault 110T and 120T devices on both FreeBSD 5.3 and on NetBSD 3.0. It also works with Sony AIT-2 drives on FreeBSD. \footnotesize -\begin{verbatim} +\begin{lstlisting} Device { ... # FreeBSD/NetBSD Specific Settings @@ -1042,7 +1039,7 @@ Device { Fast Forward Space File = yes TWO EOF = yes } -\end{verbatim} +\end{lstlisting} \normalsize On FreeBSD version 6.0, it is reported that you can even set @@ -1055,27 +1052,27 @@ Backward Space Record = yes. \index[general]{Finding Tape Drives and Autochangers on FreeBSD} On FreeBSD, you can do a {\bf camcontrol devlist} as root to determine what -drives and autochangers you have. For example, +drives and autochangers you have. For example, \footnotesize -\begin{verbatim} +\begin{lstlisting} undef# camcontrol devlist at scbus0 target 2 lun 0 (pass0,sa0) at scbus0 target 4 lun 0 (pass1,sa1) at scbus0 target 4 lun 1 (pass2) -\end{verbatim} +\end{lstlisting} \normalsize from the above, you can determine that there is a tape drive on {\bf /dev/sa0} and another on {\bf /dev/sa1} in addition since there is a second line for the drive on {\bf /dev/sa1}, you know can assume that it is the control device for the autochanger (i.e. {\bf /dev/pass2}). It is also the control device name to -use when invoking the tapeinfo program. E.g. +use when invoking the tapeinfo program. E.g. \footnotesize -\begin{verbatim} +\begin{lstlisting} tapeinfo -f /dev/pass2 -\end{verbatim} +\end{lstlisting} \normalsize \label{onstream} @@ -1085,33 +1082,33 @@ tapeinfo -f /dev/pass2 \index[general]{Systems!Using the OnStream driver on Linux} Bacula version 1.33 (not 1.32x) is now working and ready for testing with the -OnStream kernel osst driver version 0.9.14 or above. Osst is available from: +OnStream kernel osst driver version 0.9.14 or above. Osst is available from: \elink{http://sourceforge.net/projects/osst/} -{http://sourceforge.net/projects/osst/}. +{http://sourceforge.net/projects/osst/}. -To make Bacula work you must first load the new driver then, as root, do: +To make Bacula work you must first load the new driver then, as root, do: \footnotesize -\begin{verbatim} +\begin{lstlisting} mt -f /dev/nosst0 defblksize 32768 -\end{verbatim} +\end{lstlisting} \normalsize Also you must add the following to your Device resource in your Storage -daemon's conf file: +daemon's conf file: \footnotesize -\begin{verbatim} +\begin{lstlisting} Minimum Block Size = 32768 Maximum Block Size = 32768 -\end{verbatim} +\end{lstlisting} \normalsize Here is a Device specification provided by Michel Meyers that is known to -work: +work: \footnotesize -\begin{verbatim} +\begin{lstlisting} Device { Name = "Onstream DI-30" Media Type = "ADR-30" @@ -1127,7 +1124,7 @@ Device { AlwaysOpen = yes Removable Media = yes } -\end{verbatim} +\end{lstlisting} \normalsize \section{Hardware Compression on EXB-8900} @@ -1153,7 +1150,7 @@ causes it to write random data to a tape until the tape fills. It then writes at least one more Bacula block to a second tape. Finally, it reads back both tapes to ensure that the data has been written in a way that Bacula can recover it. Note, there is also a single tape option as noted below, which you -should use rather than the two tape test. See below for more details. +should use rather than the two tape test. See below for more details. This can be an extremely time consuming process (here it is about 6 hours) to fill a full tape. Note, that btape writes random data to the tape when it is @@ -1161,14 +1158,14 @@ filling it. This has two consequences: 1. it takes a bit longer to generate the data, especially on slow CPUs. 2. the total amount of data is approximately the real physical capacity of your tape, regardless of whether or not the tape drive compression is on or off. This is because random data -does not compress very much. +does not compress very much. To begin this test, you enter the {\bf fill} command and follow the instructions. There are two options: the simple single tape option and the multiple tape option. Please use only the simple single tape option because the multiple tape option still doesn't work totally correctly. If the single tape option does not succeed, you should correct the problem before using -Bacula. +Bacula. \label{RecoveringFiles} \section{Recovering Files Written With Fixed Block Sizes} @@ -1178,7 +1175,7 @@ If you have been previously running your tape drive in fixed block mode (default 512) and Bacula with variable blocks (default), then in version 1.32f-x and 1.34 and above, Bacula will fail to recover files because it does block spacing, and because the block sizes don't agree between your tape drive -and Bacula it will not work. +and Bacula it will not work. The long term solution is to run your drive in variable block mode as described above. However, if you have written tapes using fixed block sizes, @@ -1190,7 +1187,7 @@ answer the prompt {\bf yes/mod/no}. Instead, edit the bootstrap file (the location is listed in the prompt) using any ASCII editor. Remove all {\bf VolBlock} lines in the file. When the file is re-written, answer the question, and Bacula will run without using block positioning, and it should recover -your files. +your files. \label{BlockModes} \section{Tape Blocking Modes} @@ -1209,7 +1206,7 @@ written to the tape. Each read returns a single record. If you request less bytes than are in the record, only those number of bytes will be returned, but the entire logical record will have been read (the next read will retrieve the next record). Thus data from a single write is always returned in a single -read, and sequentially written records are returned by sequential reads. +read, and sequentially written records are returned by sequential reads. Bacula expects fixed block size tape drives to behave as follows: If a write length is greater than the physical block size of the drive, the write will be @@ -1223,13 +1220,13 @@ Due to the complications of fixed block size tape drives, you should avoid them if possible with Bacula, or you must be ABSOLUTELY certain that you use fixed block sizes within Bacula that correspond to the physical block size of the tape drive. This will ensure that Bacula has a one to one correspondence -between what it writes and the physical record on the tape. +between what it writes and the physical record on the tape. Please note that Bacula will not function correctly if it writes a block and that block is split into two or more physical records on the tape. Bacula assumes that each write causes a single record to be written, and that it can sequentially recover each of the blocks it has written by using the same -number of sequential reads as it had written. +number of sequential reads as it had written. \section{Details of Tape Modes} \index[general]{Modes!Details} @@ -1263,7 +1260,7 @@ certain tape modes and MTEOM. Linux does support both SCSI SPACE Filemarks and End-of-data: When MTEOM is called in MT\_ST\_FAST\_MTEOM mode, SCSI SPACE End-of-data is used. In the other case, SCSI SPACE Filemarks with count = - 8388607 is used. + 8388607 is used. There is no real slow mode like in Solaris - I just expect, that for older tape drives Filemarks may be slower than End-of-data, but not so much as in Solaris slow mode. File number is tracked for MTEOM just @@ -1306,7 +1303,7 @@ certain tape modes and MTEOM. \index[general]{Tape Performance} If you have LTO-3 or LTO-4 drives, you should be able to fairly good transfer rates; from 60 to 150 MB/second, providing -you have fast disks; GigaBit Ethernet connections (probably 2); you are +you have fast disks; GigaBit Ethernet connections (probably 2); you are running multiple simultaneous jobs; you have Bacula data spooling enabled; your tape block size is set to 131072 or 262144; and you have set {\bf Maximum File Size = 5G}. @@ -1341,9 +1338,9 @@ BIOS may be able to tell you what the rate of each device is. If you are getting errors such as: \footnotesize -\begin{verbatim} +\begin{lstlisting} 3992 Bad autochanger "load slot 1, drive 1": ERR=Child exited with code 1. -\end{verbatim} +\end{lstlisting} \normalsize and you are running your Storage daemon as non-root, then most likely @@ -1361,16 +1358,16 @@ the permissions on /dev/sg*. If you are getting errors such as: \footnotesize -\begin{verbatim} +\begin{lstlisting} : kernel: st0: MTSETDRVBUFFER only allowed for root -\end{verbatim} +\end{lstlisting} \normalsize you are most likely running your Storage daemon as non-root, and Bacula is attempting to set the correct OS buffering to correspond to your Device resource. Most OSes allow only root to issue this -ioctl command. In general, the message can be ignored providing +ioctl command. In general, the message can be ignored providing you are sure that your OS parameters are properly configured as -described earlier in this manual. If you are running your Storage daemon +described earlier in this manual. If you are running your Storage daemon as root, you should not be getting these system log messages, and if you are, something is probably wrong. diff --git a/docs/manuals/en/problems/tips.tex b/docs/manuals/en/problems/tips.tex index f13da7a0..2b805ca9 100644 --- a/docs/manuals/en/problems/tips.tex +++ b/docs/manuals/en/problems/tips.tex @@ -1,24 +1,21 @@ -%% -%% - \chapter{Tips and Suggestions} \label{TipsChapter} -\index[general]{Tips and Suggestions } -\index[general]{Suggestions!Tips and } +\index[general]{Tips and Suggestions} +\index[general]{Suggestions!Tips and} \label{examples} -\index[general]{Examples } +\index[general]{Examples} There are a number of example scripts for various things that can be found in the {\bf example} subdirectory and its subdirectories of the Bacula source -distribution. +distribution. For additional tips, please see the \elink{Bacula wiki}{http://wiki.bacula.org}. \section{Upgrading Bacula Versions} \label{upgrading} -\index[general]{Upgrading Bacula Versions } -\index[general]{Versions!Upgrading Bacula } +\index[general]{Upgrading Bacula Versions} +\index[general]{Versions!Upgrading Bacula} \index[general]{Upgrading} The first thing to do before upgrading from one version to another is to @@ -26,12 +23,12 @@ ensure that you don't overwrite or delete your production (current) version of Bacula until you have tested that the new version works. If you have installed Bacula into a single directory, this is simple: simply -make a copy of your Bacula directory. +make a copy of your Bacula directory. If you have done a more typical Unix installation where the binaries are placed in one directory and the configuration files are placed in another, then the simplest way is to configure your new Bacula to go into a single -file. Alternatively, make copies of all your binaries and especially your +file. Alternatively, make copies of all your binaries and especially your conf files. Whatever your situation may be (one of the two just described), you should @@ -42,7 +39,7 @@ Bacula, build it, install it, then stop your production Bacula, copy all the {\bf *.conf} files from your production Bacula directory to the test Bacula directory, start the test version, and run a few test backups. If all seems good, then you can proceed to install the new Bacula in place of or possibly -over the old Bacula. +over the old Bacula. When installing a new Bacula you need not worry about losing the changes you made to your configuration files as the installation process will not @@ -51,34 +48,34 @@ overwrite them providing that you do not do a {\bf make uninstall}. If the new version of Bacula requires an upgrade to the database, you can upgrade it with the script {\bf update\_bacula\_tables}, which will be installed in your scripts directory (default {\bf /etc/bacula}), -or alternatively, you can find it in the +or alternatively, you can find it in the {\bf \lt{}bacula-source\gt{}/src/cats} directory. \section{Getting Notified of Job Completion} \label{notification} -\index[general]{Getting Notified of Job Completion } -\index[general]{Completion!Getting Notified of Job } +\index[general]{Getting Notified of Job Completion} +\index[general]{Completion!Getting Notified of Job} One of the first things you should do is to ensure that you are being properly notified of the status of each Job run by Bacula, or at a minimum of each Job -that terminates with an error. +that terminates with an error. Until you are completely comfortable with {\bf Bacula}, we recommend that you send an email to yourself for each Job that is run. This is most easily accomplished by adding an email notification address in the {\bf Messages} resource of your Director's configuration file. An email is automatically configured in the default configuration files, but you must ensure that the -default {\bf root} address is replaced by your email address. +default {\bf root} address is replaced by your email address. For additional examples of how to configure a Bacula, please take a look at the {\bf .conf} files found in the {\bf examples} sub-directory. We recommend the following configuration (where you change the paths and email address to correspond to your setup). Note, the {\bf mailcommand} and {\bf operatorcommand} should be on a single line. They were split here for -presentation: +presentation: \footnotesize -\begin{verbatim} +\begin{lstlisting} Messages { Name = Standard mailcommand = "/home/bacula/bin/bsmtp -h localhost @@ -92,7 +89,7 @@ Messages { operator = your-email-address = mount console = all, !skipped, !saved } -\end{verbatim} +\end{lstlisting} \normalsize You will need to ensure that the {\bf /home/bacula/bin} path on the {\bf @@ -100,93 +97,92 @@ mailcommand} and the {\bf operatorcommand} lines point to your {\bf Bacula} binary directory where the {\bf bsmtp} program will be installed. You will also want to ensure that the {\bf your-email-address} is replaced by your email address, and finally, you will also need to ensure that the {\bf -/home/bacula/bin/log} points to the file where you want to log all messages. +/home/bacula/bin/log} points to the file where you want to log all messages. With the above Messages resource, you will be notified by email of every Job that ran, all the output will be appended to the {\bf log} file you specify, all output will be directed to the console program, and all mount messages will be emailed to you. Note, some messages will be sent to multiple -destinations. +destinations. The form of the mailcommand is a bit complicated, but it allows you to distinguish whether the Job terminated in error or terminated normally. Please -see the -\ilink{Mail Command}{mailcommand} section of the Messages -Resource chapter of this manual for the details of the substitution characters -used above. +see the +\bsysxrlink{Mail}{mailcommand}{utility}{command} in the \utilityman{} for the + details of the substitution characters used above. Once you are totally comfortable with Bacula as I am, or if you have a large number of nightly Jobs as I do (eight), you will probably want to change the {\bf Mail} command to {\bf Mail On Error} which will generate an email message only if the Job terminates in error. If the Job terminates normally, no email message will be sent, but the output will still be appended to the log file as -well as sent to the Console program. +well as sent to the Console program. \section{Getting Email Notification to Work} \label{email} -\index[general]{Work!Getting Email Notification to } -\index[general]{Getting Email Notification to Work } +\index[general]{Work!Getting Email Notification to} +\index[general]{Getting Email Notification to Work} The section above describes how to get email notification of job status. Occasionally, however, users have problems receiving any email at all. In that -case, the things to check are the following: +case, the things to check are the following: \begin{itemize} \item Ensure that you have a valid email address specified on your {\bf Mail} record in the Director's Messages resource. The email address should be fully qualified. Simply using {\bf root} generally will not work, rather you should -use {\bf root@localhost} or better yet your full domain. +use {\bf root@localhost} or better yet your full domain. \item Ensure that you do not have a {\bf Mail} record in the Storage daemon's or File daemon's configuration files. The only record you should have is {\bf - director}: + director}: \footnotesize -\begin{verbatim} +\begin{lstlisting} director = director-name = all - -\end{verbatim} + +\end{lstlisting} \normalsize -\item If all else fails, try replacing the {\bf mailcommand} with +\item If all else fails, try replacing the {\bf mailcommand} with \footnotesize -\begin{verbatim} +\begin{lstlisting} mailcommand = "mail -s test your@domain.com" -\end{verbatim} +\end{lstlisting} \normalsize \item Once the above is working, assuming you want to use {\bf bsmtp}, submit the desired bsmtp command by hand and ensure that the email is delivered, then put that command into {\bf Bacula}. Small differences in things such as the parenthesis around the word Bacula can make a big difference to some -bsmtp programs. For example, you might start simply by using: +bsmtp programs. For example, you might start simply by using: \footnotesize -\begin{verbatim} +\begin{lstlisting} mailcommand = "/home/bacula/bin/bsmtp -f \"root@localhost\" %r" -\end{verbatim} +\end{lstlisting} \normalsize \end{itemize} \section{Getting Notified that Bacula is Running} \label{JobNotification} -\index[general]{Running!Getting Notified that Bacula is } -\index[general]{Getting Notified that Bacula is Running } +\index[general]{Running!Getting Notified that Bacula is} +\index[general]{Getting Notified that Bacula is Running} If like me, you have setup Bacula so that email is sent only when a Job has errors, as described in the previous section of this chapter, inevitably, one day, something will go wrong and {\bf Bacula} can stall. This could be because Bacula crashes, which is vary rare, or more likely the network has caused {\bf -Bacula} to {\bf hang} for some unknown reason. +Bacula} to {\bf hang} for some unknown reason. To avoid this, you can use the {\bf RunAfterJob} command in the Job resource to schedule a Job nightly, or weekly that simply emails you a message saying that Bacula is still running. For example, I have setup the following Job in -my Director's configuration file: +my Director's configuration file: \footnotesize -\begin{verbatim} +\begin{lstlisting} Schedule { Name = "Watchdog" Run = Level=Full sun-sat at 6:05 @@ -212,19 +208,19 @@ Client { Job Retention = 1 month AutoPrune = yes } -\end{verbatim} +\end{lstlisting} \normalsize Where I established a schedule to run the Job nightly. The Job itself is type {\bf Admin} which means that it doesn't actually do anything, and I've defined a FileSet, Pool, Storage, and Client, all of which are not really used (and probably don't need to be specified). The key aspect of this Job is the -command: +command: \footnotesize -\begin{verbatim} +\begin{lstlisting} RunAfterJob = "/home/kern/bacula/bin/watchdog %c %d" -\end{verbatim} +\end{lstlisting} \normalsize which runs my "watchdog" script. As an example, I have added the Job codes @@ -233,27 +229,27 @@ passed to the script. For example, if the Client's name is {\bf Watchdog} and the Director's name is {\bf main-dir} then referencing \$1 in the script would get {\bf Watchdog} and referencing \$2 would get {\bf main-dir}. In this case, having the script know the Client and Director's name is not really useful, -but in other situations it may be. +but in other situations it may be. You can put anything in the watchdog script. In my case, I like to monitor the size of my catalog to be sure that {\bf Bacula} is really pruning it. The -following is my watchdog script: +following is my watchdog script: \footnotesize -\begin{verbatim} +\begin{lstlisting} #!/bin/sh cd /home/kern/mysql/var/bacula du . * | /home/kern/bacula/bin/bsmtp \ -f "\(Bacula\) abuse@whitehouse.com" -h mail.yyyy.com \ -s "Bacula running" abuse@whitehouse.com -\end{verbatim} +\end{lstlisting} \normalsize -If you just wish to send yourself a message, you can do it with: +If you just wish to send yourself a message, you can do it with: \footnotesize -\begin{verbatim} +\begin{lstlisting} #!/bin/sh cd /home/kern/mysql/var/bacula /home/kern/bacula/bin/bsmtp \ @@ -261,38 +257,37 @@ cd /home/kern/mysql/var/bacula -s "Bacula running" abuse@whitehouse.com </volume-list exit 0 -\end{verbatim} +\end{lstlisting} \normalsize -so that the whole case looks like: +so that the whole case looks like: \footnotesize -\begin{verbatim} +\begin{lstlisting} list) # # commented out lines cat /volume-list exit 0 ;; -\end{verbatim} +\end{lstlisting} \normalsize where you replace \lt{}absolute-path\gt{} with the full path to the -volume-list file. Then using the console, you enter the following command: +volume-list file. Then using the console, you enter the following command: \footnotesize -\begin{verbatim} +\begin{lstlisting} label barcodes -\end{verbatim} +\end{lstlisting} \normalsize and Bacula will proceed to mount the autochanger Volumes in the list and label them with the Volume names you have supplied. Bacula will think that the list was provided by the autochanger barcodes, but in reality, it was you who -supplied the \lt{}barcodes\gt{}. +supplied the \lt{}barcodes\gt{}. -If it seems to work, when it finishes, enter: +If it seems to work, when it finishes, enter: \footnotesize -\begin{verbatim} +\begin{lstlisting} list volumes -\end{verbatim} +\end{lstlisting} \normalsize -and you should see all the volumes nicely created. +and you should see all the volumes nicely created. \section{Backing Up Portables Using DHCP} \label{DNS} -\index[general]{DHCP!Backing Up Portables Using } -\index[general]{Backing Up Portables Using DHCP } +\index[general]{DHCP!Backing Up Portables Using} +\index[general]{Backing Up Portables Using DHCP} You may want to backup laptops or portables that are not always connected to the network. If you are using DHCP to assign an IP address to those machines when they connect, you will need to use the Dynamic Update capability of DNS to assign a name to those machines that can be used in the Address field of -the Client resource in the Director's conf file. +the Client resource in the Director's conf file. \section{Going on Vacation} \label{Vacation} -\index[general]{Vacation!Going on } -\index[general]{Going on Vacation } +\index[general]{Vacation!Going on} +\index[general]{Going on Vacation} At some point, you may want to be absent for a week or two and you want to make sure Bacula has enough tape left so that the backups will complete. You -start by doing a {\bf list volumes} in the Console program: +start by doing a {\bf list volumes} in the Console program: \footnotesize -\begin{verbatim} +\begin{lstlisting} list volumes - + Using default Catalog name=BackupDB DB=bacula Pool: Default +---------+---------------+-----------+-----------+----------------+- @@ -737,21 +732,21 @@ Pool: Default | 34 | DLT-08Aug03 | DLT8000 | Full | 64,293,941,255 | | 35 | DLT-24Aug03 | DLT8000 | Append | 9,999,216,782 | +---------+---------------+-----------+-----------+----------------+ -\end{verbatim} +\end{lstlisting} \normalsize Note, I have truncated the output for presentation purposes. What is significant, is that I can see that my current tape has almost 10 Gbytes of data, and that the average amount of data I get on my tapes is about 60 Gbytes. So if I go on vacation now, I don't need to worry about tape capacity -(at least not for short absences). +(at least not for short absences). Equally significant is the fact that I did go on vacation the 28th of June 2003, and when I did the {\bf list volumes} command, my current tape at that time, DLT-07Jun03 MediaId 31, had 56.5 Gbytes written. I could see that the tape would fill shortly. Consequently, I manually marked it as {\bf Used} and replaced it with a fresh tape that I labeled as DLT-28Jun03, thus assuring -myself that the backups would all complete without my intervention. +myself that the backups would all complete without my intervention. \section{Exclude Files on Windows Regardless of Case} \label{Case} @@ -763,23 +758,23 @@ This tip was submitted by Marc Brueckner who wasn't sure of the case of some of his files on Win32, which is case insensitive. The problem is that Bacula thinks that {\bf /UNIMPORTANT FILES} is different from {\bf /Unimportant Files}. Marc was aware that the file exclusion permits wild-cards. So, he -specified: +specified: \footnotesize -\begin{verbatim} +\begin{lstlisting} "/[Uu][Nn][Ii][Mm][Pp][Oo][Rr][Tt][Aa][Nn][Tt] [Ff][Ii][Ll][Ee][Ss]" -\end{verbatim} +\end{lstlisting} \normalsize -As a consequence, the above exclude works for files of any case. +As a consequence, the above exclude works for files of any case. Please note that this works only in Bacula Exclude statement and not in -Include. +Include. \section{Executing Scripts on a Remote Machine} \label{RemoteExecution} -\index[general]{Machine!Executing Scripts on a Remote } -\index[general]{Executing Scripts on a Remote Machine } +\index[general]{Machine!Executing Scripts on a Remote} +\index[general]{Executing Scripts on a Remote Machine} This tip also comes from Marc Brueckner. (Note, this tip is probably outdated by the addition of {\bf ClientRunBeforJob} and {\bf ClientRunAfterJob} Job @@ -793,105 +788,105 @@ while doing the backup. (Of course I have to start the services again when the backup has finished) I found the following solution: Bacula could execute scripts on the remote machine by using ssh. The authentication is done automatically using a private key. First you have to generate a keypair. I've -done this by: +done this by: \footnotesize -\begin{verbatim} +\begin{lstlisting} ssh-keygen -b 4096 -t dsa -f Bacula_key -\end{verbatim} +\end{lstlisting} \normalsize This statement may take a little time to run. It creates a public/private key pair with no passphrase. You could save the keys in /etc/bacula. Now you have two new files : Bacula\_key which contains the private key and Bacula\_key.pub -which contains the public key. +which contains the public key. Now you have to append the Bacula\_key.pub file to the file authorized\_keys in the \textbackslash{}root\textbackslash{}.ssh directory of the remote -machine. Then you have to add (or uncomment) the line +machine. Then you have to add (or uncomment) the line \footnotesize -\begin{verbatim} +\begin{lstlisting} AuthorizedKeysFile %h/.ssh/authorized_keys -\end{verbatim} +\end{lstlisting} \normalsize to the sshd\_config file on the remote machine. Where the \%h stands for the -home-directory of the user (root in this case). +home-directory of the user (root in this case). Assuming that your sshd is already running on the remote machine, you can now -enter the following on the machine where Bacula runs: +enter the following on the machine where Bacula runs: \footnotesize -\begin{verbatim} +\begin{lstlisting} ssh -i Bacula_key -l root "ls -la" -\end{verbatim} +\end{lstlisting} \normalsize -This should execute the "ls -la" command on the remote machine. +This should execute the "ls -la" command on the remote machine. -Now you could add lines like the following to your Director's conf file: +Now you could add lines like the following to your Director's conf file: \footnotesize -\begin{verbatim} +\begin{lstlisting} ... Run Before Job = ssh -i /etc/bacula/Bacula_key 192.168.1.1 \ "/etc/init.d/database stop" Run After Job = ssh -i /etc/bacula/Bacula_key 192.168.1.1 \ "/etc/init.d/database start" ... -\end{verbatim} +\end{lstlisting} \normalsize Even though Bacula version 1.32 and later has a ClientRunBeforeJob, the ssh method still could be useful for updating all the Bacula clients on several remote machines -in a single script. +in a single script. \section{Recycling All Your Volumes} \label{recycle} -\index[general]{Recycling All Your Volumes } -\index[general]{Volumes!Recycling All Your } +\index[general]{Recycling All Your Volumes} +\index[general]{Volumes!Recycling All Your} -This tip comes from Phil Stracchino. +This tip comes from Phil Stracchino. If you decide to blow away your catalog and start over, the simplest way to re-add all your prelabeled tapes with a minimum of fuss (provided you don't care about the data on the tapes) is to add the tape labels using the console {\bf add} command, then go into the catalog and manually set the VolStatus of -every tape to {\bf Recycle}. +every tape to {\bf Recycle}. The SQL command to do this is very simple, either use your vendor's command line interface (mysql, postgres, sqlite, ...) or use the sql command in the Bacula console: \footnotesize -\begin{verbatim} +\begin{lstlisting} update Media set VolStatus='Recycle'; -\end{verbatim} +\end{lstlisting} \normalsize Bacula will then ignore the data already stored on the tapes and just re-use -each tape without further objection. +each tape without further objection. \section{Backing up ACLs on ext3 or XFS filesystems} \label{ACLs} -\index[general]{Filesystems!Backing up ACLs on ext3 or XFS } -\index[general]{Backing up ACLs on ext3 or XFS filesystems } +\index[general]{Filesystems!Backing up ACLs on ext3 or XFS} +\index[general]{Backing up ACLs on ext3 or XFS filesystems} -This tip comes from Volker Sauer. +This tip comes from Volker Sauer. Note, this tip was given prior to implementation of ACLs in Bacula (version 1.34.5). It is left here because dumping/displaying ACLs can still be useful in testing/verifying that Bacula is backing up and restoring your ACLs -properly. Please see the +properly. Please see the \ilink{aclsupport}{ACLSupport} FileSet option in the -configuration chapter of this manual. +configuration chapter of this manual. For example, you could dump the ACLs to a file with a script similar to the -following: +following: \footnotesize -\begin{verbatim} +\begin{lstlisting} #!/bin/sh BACKUP_DIRS="/foo /bar" STORE_ACL=/root/acl-backup @@ -899,37 +894,37 @@ umask 077 for i in $BACKUP_DIRS; do cd $i /usr/bin/getfacl -R --skip-base .>$STORE_ACL/${i//\//_} done -\end{verbatim} +\end{lstlisting} \normalsize -Then use Bacula to backup {\bf /root/acl-backup}. +Then use Bacula to backup {\bf /root/acl-backup}. The ACLs could be restored using Bacula to the {\bf /root/acl-backup} file, -then restored to your system using: +then restored to your system using: \footnotesize -\begin{verbatim} +\begin{lstlisting} setfacl --restore/root/acl-backup -\end{verbatim} +\end{lstlisting} \normalsize \section{Total Automation of Bacula Tape Handling} \label{automate} -\index[general]{Handling!Total Automation of Bacula Tape } -\index[general]{Total Automation of Bacula Tape Handling } +\index[general]{Handling!Total Automation of Bacula Tape} +\index[general]{Total Automation of Bacula Tape Handling} -This tip was provided by Alexander Kuehn. +This tip was provided by Alexander Kuehn. \elink{Bacula}{http://www.bacula.org/} is a really nice backup program except that the manual tape changing requires user interaction with the bacula -console. +console. Fortunately I can fix this. NOTE!!! This suggestion applies for people who do *NOT* have tape autochangers -and must change tapes manually.!!!!! +and must change tapes manually.!!!!! Bacula supports a variety of tape changers through the use of mtx-changer -scripts/programs. This highly flexible approach allowed me to create +scripts/programs. This highly flexible approach allowed me to create \elink{this shell script}{http://www.bacula.org/en/rel-manual/mtx-changer.txt} which does the following: % TODO: We need to include this in book appendix and point to it. % TODO: @@ -940,10 +935,10 @@ So you can schedule and run backups without ever having to log on or see the console. To make the whole thing work you need to create a Device resource which looks something like this ("Archive Device", "Maximum Changer Wait", "Media -Type" and "Label media" may have different values): +Type" and "Label media" may have different values): \footnotesize -\begin{verbatim} +\begin{lstlisting} Device { Name=DDS3 Archive Device = # use yours not mine! ;)/dev/nsa0 @@ -958,7 +953,7 @@ Device { Offline On Unmount = Yes; # keep this too Label media = Yes; # } -\end{verbatim} +\end{lstlisting} \normalsize As the script has to emulate the complete wisdom of a mtx-changer it has an @@ -966,10 +961,10 @@ internal "database" containing where which tape is stored, you can see this on the following line: \footnotesize -\begin{verbatim} +\begin{lstlisting} labels="VOL-0001 VOL-0002 VOL-0003 VOL-0004 VOL-0005 VOL-0006 VOL-0007 VOL-0008 VOL-0009 VOL-0010 VOL-0011 VOL-0012" -\end{verbatim} +\end{lstlisting} \normalsize The above should be all on one line, and it effectively tells Bacula that @@ -986,11 +981,11 @@ its operation. Bacula can run multiple concurrent jobs, but the default configuration files do not enable it. Using the {\bf Maximum Concurrent Jobs} directive, you -can configure how many and which jobs can be run simultaneously. +can configure how many and which jobs can be run simultaneously. The Director's default value for {\bf Maximum Concurrent Jobs} is "1". -To initially setup concurrent jobs you need to define {\bf Maximum Concurrent Jobs} in -the Director's configuration file (bacula-dir.conf) in the +To initially setup concurrent jobs you need to define {\bf Maximum Concurrent Jobs} in +the Director's configuration file (bacula-dir.conf) in the Director, Job, Client, and Storage resources. Additionally the File daemon, and the Storage daemon each have their own @@ -1001,7 +996,7 @@ File daemon and the Storage daemon is "20". For example, if you want two different jobs to run simultaneously backing up the same Client to the same Storage device, they will run concurrently only if you have set {\bf Maximum Concurrent Jobs} greater than one in the Director -resource, the Client resource, and the Storage resource in bacula-dir.conf. +resource, the Client resource, and the Storage resource in bacula-dir.conf. We recommend that you read the \ilink{Data Spooling}{SpoolingChapter} of this manual first, then test your multiple @@ -1012,10 +1007,10 @@ Below is a super stripped down bacula-dir.conf file showing you the four places where the the file must be modified to allow the same job {\bf NightlySave} to run up to four times concurrently. The change to the Job resource is not necessary if you want different Jobs to run at the same time, -which is the normal case. +which is the normal case. \footnotesize -\begin{verbatim} +\begin{lstlisting} # # Bacula Director Configuration file -- bacula-dir.conf # @@ -1041,5 +1036,5 @@ Storage { Maximum Concurrent Jobs = 4 ... } -\end{verbatim} +\end{lstlisting} \normalsize diff --git a/docs/manuals/licences/coverpage.tex b/docs/manuals/licences/coverpage.tex index 25752aba..b66da733 100644 --- a/docs/manuals/licences/coverpage.tex +++ b/docs/manuals/licences/coverpage.tex @@ -3,7 +3,7 @@ \parindent 0pt \title{\includegraphics[width=0.3\linewidth]{baculasystems-logo} - \\ + \\ \Huge{Bacula\raisebox{0.1ex}{\textsuperscript\textregistered} Enterprise \bsystitle{}}} diff --git a/docs/manuals/licences/gpl.tex b/docs/manuals/licences/gpl.tex index a6f46ff1..f22b7b9e 100644 --- a/docs/manuals/licences/gpl.tex +++ b/docs/manuals/licences/gpl.tex @@ -58,7 +58,7 @@ of this license document, but changing it is not allowed. The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to -guarantee your freedom to share and change free software\verb:--:to make sure the +guarantee your freedom to share and change free software\lstinline:--:to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is @@ -367,7 +367,7 @@ for details. The hypothetical commands {\tt `show w'} and {\tt `show c'} should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than {\tt `show w'} and {\tt `show c'}; they -could even be mouse-clicks or menu items\verb:--:whatever suits your program. +could even be mouse-clicks or menu items\lstinline:--:whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if diff --git a/docs/manuals/licences/lesser.tex b/docs/manuals/licences/lesser.tex index a85c9859..c0bdf697 100644 --- a/docs/manuals/licences/lesser.tex +++ b/docs/manuals/licences/lesser.tex @@ -79,11 +79,11 @@ of this license document, but changing it is not allowed. The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to -guarantee your freedom to share and change free software\verb:--:to make sure the +guarantee your freedom to share and change free software\lstinline:--:to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially -designated software packages\verb:--:typically libraries\verb:--:of the Free Software +designated software packages\lstinline:--:typically libraries\lstinline:--:of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, diff --git a/docs/manuals/licences/license.tex b/docs/manuals/licences/license.tex new file mode 100644 index 00000000..27134620 --- /dev/null +++ b/docs/manuals/licences/license.tex @@ -0,0 +1,102 @@ +\chapter{Bacula Copyright, Trademark, and Licenses} +\label{LicenseChapter} +\index[general]{Licenses!Bacula Copyright Trademark} +\index[general]{Bacula Copyright, Trademark, and Licenses} + +There are a number of different licenses that are used in Bacula. +If you have a printed copy of this manual, the details of each of +the licenses referred to in this chapter can be found in the +online version of the manual at +\elink{http://www.bacula.org}{http://www.bacula.org}. + +\section{FDL} +\index[general]{FDL} + +The GNU Free Documentation License (FDL) is used for this manual, +which is a free and open license. This means that you may freely +reproduce it and even make changes to it. However, rather than +distribute your own version of this manual, we would much prefer +if you would send any corrections or changes to the Bacula project. + +The most recent version of the manual can always be found online +at \elink{http://www.bacula.org}{http://www.bacula.org}. + +\section{GPL} +\index[general]{GPL} + +The vast bulk of the source code is released under the +\ilink{GNU Affero General Public License version 3.}{GplChapter}. + +Most of this code is copyrighted: Copyright \copyright 2000-\the\year{} +Free Software Foundation Europe e.V. + +Portions may be copyrighted by other people. These files are released +under different licenses which are compatible with the Bacula AGPLv3 license. + +\section{LGPL} +\index[general]{LGPL} + +Some of the Bacula library source code is released under the +\ilink{GNU Lesser General Public License.}{LesserChapter} This +permits third parties to use these parts of our code in their proprietary +programs to interface to Bacula. + +\section{Public Domain} +\index[general]{Domain!Public} +\index[general]{Public Domain} + +Some of the Bacula code, or code that Bacula references, has been released +to the public domain. E.g. md5.c, SQLite. + +\section{Trademark} +\index[general]{Trademark} + +Bacula\raisebox{.3ex}{\textsuperscript{\textregistered}} is a registered +trademark of Kern Sibbald. + +\section{Fiduciary License Agreement} +\index[general]{Fiduciary License Agreement} +Developers who have contributed significant changes to the Bacula code +should have signed a Fiduciary License Agreement (FLA), which +guarantees them the right to use the code they have developed, and also +ensures that the Free Software Foundation Europe (and thus the Bacula +project) has the rights to the code. This Fiduciary License Agreement +is found on the Bacula web site at: + +\elink{http://www.bacula.org/en/FLA-bacula.en.pdf}{http://www.bacula.org/en/FLA-bacula.en.pdf} + +and if you are submitting code, you should fill it out then sent to: + +\begin{quote} + Kern Sibbald \\ + Cotes-de-Montmoiret 9 \\ + 1012 Lausanne \\ + Switzerland \\ +\end{quote} + +When you send in such a +complete document, please notify me: kern at sibbald dot com. + + +\section{Disclaimer} +\index[general]{Disclaimer} + +NO WARRANTY + +BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE +PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE +PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, +YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY +COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE +OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR +DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR +A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH +HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -- 2.39.5