\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.
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:
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}
+<separator-keyword> = / ! ; % : , ~ # = &
+\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 }