From 64bba5d131d8e95984251a90bfb47acea05649aa Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 3 May 2007 20:33:50 +0000 Subject: [PATCH] ebl update file restoration doc --- docs/manual/restore.tex | 55 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/docs/manual/restore.tex b/docs/manual/restore.tex index 33add485..7234deee 100644 --- a/docs/manual/restore.tex +++ b/docs/manual/restore.tex @@ -610,6 +610,8 @@ informations and examples. \index[general]{Using File Relocation} \label{filerelocation} +\subsection{Introduction} + The \textbf{where=} option is simple, but not very powerful. With file relocation, bacula can restore a file in the same directory, but with a different name, or in an other directory without recreating the full path. @@ -621,8 +623,9 @@ to move the file to \texttt{/home/eric/mbox.bkp} by hand. In this case, you can use \textbf{strip\_prefix=/.snap} and \textbf{add\_suffix=.bkp} options and bacula will do the job. -To use this feature, your can \ref{restorefilerelocation} use restore command -line options, or modify your restore job before running it. +To use this feature, your can use \ilink{restore}{restorefilerelocation} +command line options, or modify your restore job before running it, or add +options to your base restore job in \ilink{bacula-dir.conf}{confaddprefix}. \begin{verbatim} Parameters to modify: @@ -644,7 +647,53 @@ This will replace your current Where value Select parameter to modify (1-6): \end{verbatim} -TODO: add more example (change windows drive, sed test) + +\subsection{RegexWhere format} + +The format is very close to that used by sed or Perl (\texttt{s/replace this/by + that/}) operator. A valid regexwhere expression have 3 fields : +\begin{itemize} +\item a search expression (with optionnal submatch) +\item a replacement expression (with optionnal backreferences \$1 to \$9) +\item a set of search options (only case-insensitive ``i'' at this time) +\end{itemize} + +Each fields is delimited by a separator chosen by the user at the beginning +expression. The separator can be : +\begin{verbatim} + = / ! ; % : , ~ # = & +\end{verbatim} + +You can use several expressions separated by a comma. + +\subsection*{Examples} + +\begin{tabular}{|c|c|c|l} +\hline +Orignal filename & Computed filename & RegexWhere & Comments \\ +\hline +\hline +\texttt{c:/system.ini} & \texttt{c:/system.old.ini} & \texttt{/.ini\$/.old.ini/} & use \$ as end of filename\\ +\hline +\texttt{/prod/u01/pdata/} & \texttt{/rect/u01/rdata} & \texttt{/prod/rect/,/pdata/rdata/} & using two regexp\\ +\hline +\texttt{/prod/u01/pdata/} & \texttt{/rect/u01/rdata} & \texttt{!/prod/!/rect/!,/pdata/rdata/} & using \texttt{!} instead of \texttt{/}\\ +\hline +\texttt{C:/WINNT} & \texttt{d:/WINNT} & \texttt{/c:/d:/i} & using case-insensitive pattern matching \\ +\hline + +\end{tabular} + +%\subsubsection{Using group} +% +%Like with Perl or Sed, you can make submatch with \texttt{()}, +% +%\subsubsection*{Examples} + + +%\subsubsection{Options} +% +% i Do case-insensitive pattern matching. \section{Restoring Directory Attributes} \index[general]{Attributes!Restoring Directory } -- 2.39.5