From: Eric Bollengier Date: Thu, 26 Apr 2007 20:48:15 +0000 (+0000) Subject: ebl first cup of documentation about file relocation X-Git-Tag: Release-2.2.0~637 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7daf18f1363763ed16689458d4d69e7576ea5748;p=bacula%2Fdocs ebl first cup of documentation about file relocation --- diff --git a/docs/manual/restore.tex b/docs/manual/restore.tex index 27be4355..33add485 100644 --- a/docs/manual/restore.tex +++ b/docs/manual/restore.tex @@ -586,10 +586,66 @@ The full list of possible command line arguments are: Volumes when specifying options 5 and 6 (restore current system, and restore current system before given date). This permits you to have several Pools, possibly one offsite, and to select the Pool to be used for restoring. +\item {\bf where=/tmp/bacula-restore} -- restore files in {\bf where} directory. \item {\bf yes} -- automatically run the restore without prompting for modifications (most useful in batch scripts). \end{itemize} +\label{restorefilerelocation} +You can also do filename and path manipulations (need bacula 2.2.0 or later) +like adding a suffix to all your files, rename files or directories etc. Theses +options will overwrite {\bf where=} option. See \ref{filerelocation} for more +informations and examples. + +\begin{itemize} +\item {\bf strip\_prefix=/prod} -- remove a part of the filename when restoring. +\item {\bf add\_prefix=/test} -- add a prefix to all files when restoring (like + where) (can't be used with {\bf where=}). +\item {\bf add\_suffix=.old} -- add a suffix to all your files. +\item {\bf regexwhere=!a.pdf!a.bkp.pdf!} -- do complex filename manipulation + like with sed unix command. Will overwrite other filename manipulation. +\end{itemize} + +\section{Using File Relocation} +\index[general]{Using File Relocation} +\label{filerelocation} + +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. + +For example, many users are using snapshot, \texttt{/home/eric/mbox} will be +backuped as \texttt{/.snap/home/eric/mbox}. If you use \textbf{where=/tmp}, the +file will be restored to \texttt{/tmp/.snap/home/eric/mbox} and you will have +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. + +\begin{verbatim} +Parameters to modify: + 1: Level + 2: Storage +.. + 10: File Relocation +.. +Select parameter to modify (1-12): + + +This will replace your current Where value + 1: Strip prefix + 2: Add prefix + 3: Add file suffix + 4: Enter a regexp + 5: Test filename manipulation + 6: Use this ? +Select parameter to modify (1-6): +\end{verbatim} + +TODO: add more example (change windows drive, sed test) + \section{Restoring Directory Attributes} \index[general]{Attributes!Restoring Directory } \index[general]{Restoring Directory Attributes }