diff --git a/manuals/en/main/bareos.sty b/manuals/en/main/bareos.sty index 5928b36..a7e7e52 100644 --- a/manuals/en/main/bareos.sty +++ b/manuals/en/main/bareos.sty @@ -356,12 +356,12 @@ Version $>=$ #3% }{} +\definecolor{colorConfig}{gray}{0.9} \lstnewenvironment{bconfig}[1]{% % #1 caption \renewcommand*{\lstlistingname}{Configuration} \footnotesize - \definecolor{colorConfig}{gray}{0.9} \lstset{ backgroundcolor=\color{colorConfig}, frame=single, @@ -377,6 +377,19 @@ Version $>=$ #3% } }{} +\newcommand{\bconfigInput}[1]{ + { + \footnotesize +% \lstinputlisting[backgroundcolor=\color{colorConfig},frame=single,framerule=0pt,basicstyle=\ttfamily,keepspaces=true,columns=fullflexible,moredelim=[is][\it]{}{},moredelim=[is][\underline]{}{}]{#1} + \lstinputlisting[ + backgroundcolor=\color{colorConfig}, + frame=single,framerule=0pt, + basicstyle=\ttfamily, + keepspaces=true, + columns=fullflexible + ]{#1} + } +} \lstnewenvironment{config}[1]{% % #1 caption diff --git a/manuals/en/main/config/DirJobRun1.conf b/manuals/en/main/config/DirJobRun1.conf new file mode 100644 index 0000000..16d733d --- /dev/null +++ b/manuals/en/main/config/DirJobRun1.conf @@ -0,0 +1,2 @@ +run = "Nightly-backup level=%l since=\"%s\" storage=DDS-4" + diff --git a/manuals/en/main/config/DirJobRunAfterFailedJob1.conf b/manuals/en/main/config/DirJobRunAfterFailedJob1.conf new file mode 100644 index 0000000..a695540 --- /dev/null +++ b/manuals/en/main/config/DirJobRunAfterFailedJob1.conf @@ -0,0 +1,8 @@ +Run Script { + Command = "echo test" + Runs When = After + Runs On Failure = yes + Runs On Client = no + Runs On Success = yes # default, you can drop this line +} + diff --git a/manuals/en/main/config/DirJobRunBeforeJob1.conf b/manuals/en/main/config/DirJobRunBeforeJob1.conf new file mode 100644 index 0000000..9aa8a9f --- /dev/null +++ b/manuals/en/main/config/DirJobRunBeforeJob1.conf @@ -0,0 +1,2 @@ +Run Before Job = "echo test" + diff --git a/manuals/en/main/config/DirJobRunBeforeJob2.conf b/manuals/en/main/config/DirJobRunBeforeJob2.conf new file mode 100644 index 0000000..5f7c480 --- /dev/null +++ b/manuals/en/main/config/DirJobRunBeforeJob2.conf @@ -0,0 +1,5 @@ +Run Script { + Command = "echo test" + Runs On Client = No + Runs When = Before +} diff --git a/manuals/en/main/config/DirJobRunScript1.conf b/manuals/en/main/config/DirJobRunScript1.conf new file mode 100644 index 0000000..db3d417 --- /dev/null +++ b/manuals/en/main/config/DirJobRunScript1.conf @@ -0,0 +1,2 @@ +Console = "prune files client=\%c" +Console = "update stats age=3" diff --git a/manuals/en/main/config/DirJobRunScript2.conf b/manuals/en/main/config/DirJobRunScript2.conf new file mode 100644 index 0000000..bc24a23 --- /dev/null +++ b/manuals/en/main/config/DirJobRunScript2.conf @@ -0,0 +1,11 @@ +Run Script { + RunsWhen = Before + FailJobOnError = No + Command = "/etc/init.d/apache stop" +} + +RunScript { + RunsWhen = After + RunsOnFailure = Yes + Command = "/etc/init.d/apache start" +} diff --git a/manuals/en/main/config/DirJobRunScript3.conf b/manuals/en/main/config/DirJobRunScript3.conf new file mode 100644 index 0000000..eaad7c2 --- /dev/null +++ b/manuals/en/main/config/DirJobRunScript3.conf @@ -0,0 +1,5 @@ + Client Run Before Job = "systemstate" +or + Client Run Before Job = "systemstate.bat" +or + Client Run Before Job = "\"C:/Program Files/Bareos/systemstate.bat\"" diff --git a/manuals/en/main/config/DirJobStripPrefix1.conf b/manuals/en/main/config/DirJobStripPrefix1.conf new file mode 100644 index 0000000..d7b4a58 --- /dev/null +++ b/manuals/en/main/config/DirJobStripPrefix1.conf @@ -0,0 +1,2 @@ +Strip Prefix = c: +Add Prefix = d: diff --git a/manuals/en/main/config/DirJobWriteBootstrap1.conf b/manuals/en/main/config/DirJobWriteBootstrap1.conf new file mode 100644 index 0000000..4d9d203 --- /dev/null +++ b/manuals/en/main/config/DirJobWriteBootstrap1.conf @@ -0,0 +1,5 @@ +Job Defs { + ... + Write Bootstrap = "%c_%n.bsr" + ... +} diff --git a/manuals/en/main/config/DirPoolActionOnPurge1.conf b/manuals/en/main/config/DirPoolActionOnPurge1.conf new file mode 100644 index 0000000..e3808c4 --- /dev/null +++ b/manuals/en/main/config/DirPoolActionOnPurge1.conf @@ -0,0 +1,5 @@ +Pool { + Name = Default + Action On Purge = Truncate + ... +} diff --git a/manuals/en/main/config/DirPoolActionOnPurge2.conf b/manuals/en/main/config/DirPoolActionOnPurge2.conf new file mode 100644 index 0000000..03fc95d --- /dev/null +++ b/manuals/en/main/config/DirPoolActionOnPurge2.conf @@ -0,0 +1,9 @@ +Job { + Name = CatalogBackup + ... + RunScript { + RunsWhen=After + RunsOnClient=No + Console = "purge volume action=all allpools storage=File" + } +} diff --git a/manuals/en/main/director-resource-job-definitions.tex b/manuals/en/main/director-resource-job-definitions.tex index a1ee17e..9693d54 100644 --- a/manuals/en/main/director-resource-job-definitions.tex +++ b/manuals/en/main/director-resource-job-definitions.tex @@ -832,9 +832,10 @@ enclosed in double quotes, and thus they must be preceded by a backslash since they are already inside quotes. For example: -\begin{bconfig}{}^^J - run = "Nightly-backup level=\%l since=\\"\%s\\" storage=DDS-4"^^J -\end{bconfig} +% \begin{bconfig}{}^^J +% run = "Nightly-backup level=\%l since=\\"\%s\\" storage=DDS-4"^^J +% \end{bconfig} +\bconfigInput{config/DirJobRun1.conf} A cloned job will not start additional clones, so it is not possible to recurse. @@ -862,15 +863,16 @@ for the {\bf RunScript} directive. Note, if you wish that your script will run regardless of the exit status of the Job, you can use this: -\begin{bconfig}{Run Script that runs after all jobs (successful and failed)}^^J -Run Script \{^^J -\ Command = "echo test"^^J -\ Runs When = After^^J -\ Runs On Failure = yes^^J -\ Runs On Client = no^^J -\ Runs On Success = yes \# default, you can drop this line^^J -\}^^J -\end{bconfig} +% \begin{bconfig}{Run Script that runs after all jobs (successful and failed)}^^J +% Run Script \{^^J +% \ Command = "echo test"^^J +% \ Runs When = After^^J +% \ Runs On Failure = yes^^J +% \ Runs On Client = no^^J +% \ Runs On Success = yes \# default, you can drop this line^^J +% \}^^J +% \end{bconfig} +\bconfigInput{config/DirJobRunAfterFailedJob1.conf} } \defDirective{Dir}{Job}{Run After Job}{}{}{% @@ -895,19 +897,21 @@ exit code of the program run is non-zero, the current Bareos job will be canceled. -\begin{bconfig}{}^^J -Run Before Job = "echo test"^^J -\end{bconfig} +% \begin{bconfig}{}^^J +% Run Before Job = "echo test"^^J +% \end{bconfig} +\bconfigInput{config/DirJobRunBeforeJob1.conf} it's equivalent to : -\begin{bconfig}{}^^J -RunScript \{^^J -\ Command = "echo test"^^J -\ Runs On Client = No^^J -\ Runs When = Before^^J -\}^^J -\end{bconfig} +% \begin{bconfig}{}^^J +% RunScript \{^^J +% \ Command = "echo test"^^J +% \ Runs On Client = No^^J +% \ Runs When = Before^^J +% \}^^J +% \end{bconfig} +\bconfigInput{config/DirJobRunBeforeJob2.conf} % % Lutz Kittler has pointed out that using the RunBeforeJob directive can be a % simple way to modify your schedules during a holiday. For example, suppose @@ -941,10 +945,11 @@ more information. You need to specify needed information on command line, nothing will be prompted. Example: -\begin{bconfig}{Run Script Console commands}^^J - Console = "prune files client=\%c"^^J - Console = "update stats age=3"^^J -\end{bconfig} +% \begin{bconfig}{Run Script Console commands}^^J +% Console = "prune files client=\%c"^^J +% Console = "update stats age=3"^^J +% \end{bconfig} +\bconfigInput{config/DirJobRunScript1.conf} You can specify more than one Command/Console option per RunScript. @@ -1051,19 +1056,20 @@ \end{tabular} Examples: -\begin{bconfig}{Run Script Examples}^^J -RunScript \{^^J -\ \ RunsWhen = Before^^J -\ \ FailJobOnError = No^^J -\ \ Command = "/etc/init.d/apache stop"^^J -\}^^J -^^J -RunScript \{^^J -\ \ RunsWhen = After^^J -\ \ RunsOnFailure = yes^^J -\ \ Command = "/etc/init.d/apache start"^^J -\}^^J -\end{bconfig} +% \begin{bconfig}{Run Script Examples}^^J +% RunScript \{^^J +% \ \ RunsWhen = Before^^J +% \ \ FailJobOnError = No^^J +% \ \ Command = "/etc/init.d/apache stop"^^J +% \}^^J +% ^^J +% RunScript \{^^J +% \ \ RunsWhen = After^^J +% \ \ RunsOnFailure = yes^^J +% \ \ Command = "/etc/init.d/apache start"^^J +% \}^^J +% \end{bconfig} +\bconfigInput{config/DirJobRunScript2.conf} {\bf Notes about ClientRunBeforeJob} @@ -1116,13 +1122,14 @@ %\end{bconfig} % \normalsize -\begin{bconfig}{Windows systemstate Run Script}^^J - Client Run Before Job = "systemstate"^^J -or^^J - Client Run Before Job = "systemstate.bat"^^J -or^^J - Client Run Before Job = "\\"C:/Program Files/Bareos/systemstate.bat\\""^^J -\end{bconfig} +% \begin{bconfig}{Windows systemstate Run Script}^^J +% Client Run Before Job = "systemstate"^^J +% or^^J +% Client Run Before Job = "systemstate.bat"^^J +% or^^J +% Client Run Before Job = "\\"C:/Program Files/Bareos/systemstate.bat\\""^^J +% \end{bconfig} +\bconfigInput{config/DirJobRunScript3.conf} % \begin{itemize} % \item \path|Client Run Before Job = "systemstate"| @@ -1340,10 +1347,12 @@ Under Windows, if you want to restore \texttt{c:/files} to \texttt{d:/files}, you can use: -\begin{bconfig}{}^^J - Strip Prefix = c:^^J - Add Prefix = d:^^J -\end{bconfig} +% \begin{bconfig}{}^^J +% Strip Prefix = c:^^J +% Add Prefix = d:^^J +% \end{bconfig} +% +\bconfigInput{config/DirJobStripPrefix1.conf} } \defDirective{Dir}{Job}{Type}{}{}{% @@ -1442,12 +1451,13 @@ \ilink{character substitution}{character substitution} like in RunScript directive. To automatically manage your bootstrap files, you can use this in your {\bf JobDefs} resources: -\begin{bconfig}{Write Bootstrap Example}^^J -Job Defs \{^^J -\ \ Write Bootstrap = "\%c_\%n.bsr"^^J -\ \ ...^^J -\}^^J -\end{bconfig} +% \begin{bconfig}{Write Bootstrap Example}^^J +% Job Defs \{^^J +% \ \ Write Bootstrap = "\%c_\%n.bsr"^^J +% \ \ ...^^J +% \}^^J +% \end{bconfig} +\bconfigInput{config/DirJobWriteBootstrap1.conf} For more details on using this file, please see chapter \nameref{BootstrapChapter}. } diff --git a/manuals/en/main/director-resource-pool-definitions.tex b/manuals/en/main/director-resource-pool-definitions.tex index bece270..155c67b 100644 --- a/manuals/en/main/director-resource-pool-definitions.tex +++ b/manuals/en/main/director-resource-pool-definitions.tex @@ -4,28 +4,31 @@ command. It is useful to prevent disk based volumes from consuming too much space. -\begin{bconfig}{}^^J -Pool \{^^J -\ Name = Default^^J -\ Action On Purge = Truncate^^J -\ ...^^J -\}^^J -\end{bconfig} +% \begin{bconfig}{}^^J +% Pool \{^^J +% \ Name = Default^^J +% \ Action On Purge = Truncate^^J +% \ ...^^J +% \}^^J +% \end{bconfig} +\bconfigInput{config/DirPoolActionOnPurge1.conf} + You can schedule the truncate operation at the end of your CatalogBackup job like in this example: -\begin{bconfig}{}^^J -Job \{^^J -\ Name = CatalogBackup^^J -\ ...^^J -\ RunScript \{^^J -\ \ RunsWhen=After^^J -\ \ RunsOnClient=No^^J -\ \ Console = "purge volume action=all allpools storage=File"^^J -\ \}^^J -\}^^J -\end{bconfig} +% \begin{bconfig}{}^^J +% Job \{^^J +% \ Name = CatalogBackup^^J +% \ ...^^J +% \ RunScript \{^^J +% \ \ RunsWhen=After^^J +% \ \ RunsOnClient=No^^J +% \ \ Console = "purge volume action=all allpools storage=File"^^J +% \ \}^^J +% \}^^J +% \end{bconfig} +\bconfigInput{config/DirPoolActionOnPurge2.conf} } \defDirective{Dir}{Pool}{Autoprune}{}{}{%