From d8f8931c5e32b13ce509fdfb4ad2a5e375cb39a1 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 10 Oct 2008 10:17:20 +0000 Subject: [PATCH] Update --- docs/manuals/en/concepts/concepts.kilepr | 4 +- docs/manuals/en/concepts/newfeatures.tex | 187 ++++++++++++++++++++++- docs/manuals/en/install/dirdconf.tex | 2 - docs/manuals/en/install/install.kilepr | 4 +- 4 files changed, 185 insertions(+), 12 deletions(-) diff --git a/docs/manuals/en/concepts/concepts.kilepr b/docs/manuals/en/concepts/concepts.kilepr index f0abd040..f3181fac 100644 --- a/docs/manuals/en/concepts/concepts.kilepr +++ b/docs/manuals/en/concepts/concepts.kilepr @@ -161,10 +161,10 @@ order=-1 [item:newfeatures.tex] archive=true -column=49 +column=58 encoding=UTF-8 highlight=LaTeX -line=544 +line=938 open=true order=0 diff --git a/docs/manuals/en/concepts/newfeatures.tex b/docs/manuals/en/concepts/newfeatures.tex index 5a571dc9..b52830f2 100644 --- a/docs/manuals/en/concepts/newfeatures.tex +++ b/docs/manuals/en/concepts/newfeatures.tex @@ -442,6 +442,131 @@ By using different command lines to {\bf bpipe}, you can backup any kind of data (ASCII or binary) depending on the program called. +\section{Microsoft Exchange Server 2003/2007 plugin} + +\subsection{Concepts} + +Microsoft Exchange organises its storage into Storage Groups with +Databases inside them. A default installation of Exchange will have a +single Storage Group called 'First Storage Group', with two Databases +inside it, 'Mailbox Store (SERVER NAME)' and 'Public Folder Store +(SERVER NAME)', which hold user email and public folders respectively. + +In the default configuration, Exchange logs everything that happens to +log files, such that if you have a backup, and all the log files since, +you can restore to the present time. Each Storage Group has its own set +of log files and operates independently of any other Storage Groups. At +the Storage Group level, the logging can be turned off by enabling a +function called 'Enable circular logging'. At this time the Exchange +plugin will not function if this option is enabled. + +The plugin allows backing up of entire storage groups, and the restoring +of entire storage groups or individual databases. Backing up and +restoring at the individual mailbox or email item is not supported but +can be simulate by use of the Recovery Storage Group (see below). + +\subsection{Installing} + +Once the bacula-fd is installed on your Windows server, the Exchange API +DLL must be copied to the bin directory in the Bacula installation +directory (eg C:\\Program Files\\Bacula\\bin). The Exchange API DLL is +named esebcli2.dll and is found in C:\\Program Files\\Exchsrvr\\bin on a +default Exchange installation. + +We plan to make the plugin a bit smarter about finding the +esebcli2.dll file, so the step here will ultimately only be as a last +resort, but for now it is required. + + +\subsection{Backup up} + +To back up an Exchange server the Fileset definition must contain at +least 'Plugin = "exchange:/@EXCHANGE/Microsoft Information Store"' for +the backup to work correctly. The 'exchange:' bit tells Bacula to look +for the exchange plugin, the '@EXCHANGE' bit makes sure all the backed +up files are prefixed with something that isn't going to share a name +with something outside the plugin, and the 'Microsoft Information Store' +bit is required also. It is also possible to add the name of a storage +group to the 'Plugin =' line, eg 'Plugin = +"exchange:/@EXCHANGE/Microsoft Information Store/First Storage Group"' +if you want only a single storage group backed up. + +Additionally, you can suffix the 'Plugin =' directive with +':notrunconfull' which will tell the plugin not to truncate the Exchange +database at the end of a full backup. + +An Incremental or Differential backup will backup only the database logs +for each Storage Group by inspecting the 'modified date' on each +physical log file. Because of the way the Exchange API works, the last +logfile backed up on each backup will always be backed up by the next +Incremental or Differential backup too. This adds 5MB to each +Incremental or Differential backup size but otherwise does not cause any +problems. + +\subsection{Restoring} + +The restore operation is much the same as a normal Bacula restore, with +the following provisos: + +\begin{itemize} +\item The 'Where' restore option must not be specified +\item Each Database directory must be marked as a whole. You cannot just + select (say) the .edb file and not the others. +\item If a Storage Group is restored, the directory of the Storage Group + must be marked too. +\item It is possible to restore only a subset of the available log files, + but they {\bf must} be contiguous. Exchange will fail to restore correctly + if a log file is missing from the sequence of log files +\item Each database to be restored must be dismounted and marked as 'Can be + overwritten by restore' +\item If an entire Storage Group is to be restored (eg all databases and + logs in the Storage Group), then it is best to manually delete the + database files from the server (eg C:\\Program Files\\Exchsrvr\\mdbdata\\*) + as Exchange can get confused by stray log files lying around. +\end{itemize} + +\subsection{Restoring to the Recovery Storage Group} + +The concept of the Recovery Storage Group is well documented by +Microsoft (find a link and put it here), but to briefly summarise... + +Microsoft Exchange allows the creation of an additional Storage Group +called the Recovery Storage Group, which is used to restore an older +copy of a database (eg before a mailbox was deleted) into without +messing with the current live data. This is required as the Standard and +Small Business Server versions of Exchange can not ordinarily have more +than one Storage Group. + +To create the Recovery Storage Group, drill down to the Server in +Exchange System Manager, right click, and select 'New -> Recovery +Storage Group...'. Accept or change the file locations and click OK. On +the Recovery Storage Group, right click and select 'Add Database to +Recover...' and select the database you will be restoring. + +In Bacula, select the Database and the log files, making sure to mark +the Storage Group directory itself too. Once you have selected the files +to back up, use the RegexWhere clause to remove the prefix of +'/@EXCHANGE/Microsoft Information Store//' and +replace it with '/@EXCHANGE/Microsoft Information Store/Recovery Storage +Group/'. Then run the restore. + +\subsection{}Caveats + +The 'Enable Circular Logging' option cannot be enabled or the plugin +will fail. + +Exchange insists that a successful Full backup must have taken place if +an Incremental or Differential backup is desired, and the plugin will +fail if this is not the case. If a restore is done, Exchange will +require that a Full backup be done before an Incremental or Differential +backup is done. + +The plugin will most likely not work well if another backup application +(eg NTBACKUP) is backing up the Exchange database, especially if the +other backup application is truncating the log files. + + + \section{libdbi framework} As a general guideline, Bacula has support for a few catalog database drivers coded natively by the Bacula team. With the libdbi implementation, which is a @@ -779,6 +904,48 @@ exported entry points, place it in the {\bf Plugins Directory}, which is defined starts, it will load all the plugins that end with {\bf -fd.so} (or {\bf -fd.dll} on Win32) found in that directory. +\section{Normal vs Command Plugins} +In general, there are two ways that plugins are called. The first way, +is when a particular event is detected in Bacula, it will transfer control +to each plugin that is loaded in turn informing the plugin of the event. +This is very similar to how a {\bf RunScript} works, and the events are very similar. +Once the plugin gets control, it can interact with Bacula by getting and +setting Bacula variables. In this way, it behaves much like a RunScript. +Currently very few Bacula variables are defined, but they will be implemented +as the need arrises, and it is very extensible. + +We plan to have plugins register to receive events that they normally would +not receive, such as an event for each file examined for backup or restore. +This feature is not yet implemented. + +The second type of plugin, which is more useful and fully implemented +in the current version is what we call a command plugin. As with all +plugins, it gets notified of important events as noted above (details described below), +but in addition, this kind of plugin can accept a command line, which +is a: + +\begin{verbatim} + Plugin = +\end{verbatim} + +directive that is placed in the Include section of a FileSet and is very +similar to the "File = " directive. When this Plugin directive is encountered +by Bacula during backup, it passes the "command" part of the Plugin directive +only to the plugin that is explicitly named in the first field of that command string. +This allows that plugin to backup any file or files on the system that it wants. It can +even create "virtual files" in the catalog that contain data to be restored but do +not necessarily correspond to actual files on the filesystem. + +The important features of the command plugin entry points are: +\begin{itemize} + \item It is triggered by a "Plugin =" directive in the FileSet + \item Only a single plugin is called that is named on the "Plugin =" directive. + \item The full command string after the "Plugin =" is passed to the plugin + so that it can be told what to backup/restore. +\end{itemize} + + +\section{Loading Plugins} Once the File daemon loads the plugins, it asks the OS for the two entry points (loadPlugin and unloadPlugin) then calls the {\bf loadPlugin} entry point (see below). @@ -888,6 +1055,9 @@ typedef struct s_baculaFuncs { int type, time_t mtime, const char *fmt, ...); bRC (*DebugMessage)(bpContext *ctx, const char *file, int line, int level, const char *fmt, ...); + void *(*malloc)(bpContext *ctx, const char *file, int line, + size_t size); + void (*free)(bpContext *ctx, const char *file, int line, void *mem); } bFuncs; \end{verbatim} @@ -1170,6 +1340,9 @@ was passed during the {\bf loadPlugin} call and get to a number of Bacula variab at a future time and as needs require). \subsection{startBackupFile(bpContext *ctx, struct save\_pkt *sp)} +This entry point is called only if your plugin is a command plugin, and +it is called when Bacula encounters the "Plugin = " directive in +the Include section of the FileSet. Called when beginning the backup of a file. Here Bacula provides you with a pointer to the {\bf save\_pkt} structure and you must fill in this packet with the "attribute" data of the file. @@ -1258,17 +1431,19 @@ to do a backup while processing the "Plugin = " directive are: \subsection{endBackupFile(bpContext *ctx)} -Called at the end of backing up a file. If the plugin's work +Called at the end of backing up a file for a command plugin. If the plugin's work is done, it should return bRC\_OK. If the plugin wishes to create another file and back it up, then it must return bRC\_More (not yet implemented). This is probably a good time to release any malloc()ed memory you used to pass back filenames. \subsection{startRestoreFile(bpContext *ctx, const char *cmd)} -Not yet implemented. +Called when the first record is read from the Volume that was +previously written by the command plugin. \subsection{createFile(bpContext *ctx, struct restore\_pkt *rp)} -Called to create a file during a Restore job before restoring the data. +Called for a command plugin to create a file during a Restore job before +restoring the data. This entry point is called before any I/O is done on the file. After this call, Bacula will call pluginIO() to open the file for write. @@ -1371,16 +1546,16 @@ the directory permissions. If you do it the other way around, each time you restore a file, the OS will modify the time values for the directory entry. \subsection{setFileAttributes(bpContext *ctx, struct restore\_pkt *rp)} -This is call not yet implemented. +This is call not yet implemented. Called for a command plugin. See the definition of {\bf restre\_pkt} in the above section. \subsection{endRestoreFile(bpContext *ctx)} -Called when done restoring a file. +Called when a command plugin is done restoring a file. \subsection{pluginIO(bpContext *ctx, struct io\_pkt *io)} Called to do the input (backup) or output (restore) of data from or to a -file. These routines simulate the Unix read(), write(), open(), close(), +file for a command plugin. These routines simulate the Unix read(), write(), open(), close(), and lseek() I/O calls, and the arguments are passed in the packet and the return values are also placed in the packet. In addition for Win32 systems the plugin must return two additional values (described below). diff --git a/docs/manuals/en/install/dirdconf.tex b/docs/manuals/en/install/dirdconf.tex index 21741bea..0f9c227c 100644 --- a/docs/manuals/en/install/dirdconf.tex +++ b/docs/manuals/en/install/dirdconf.tex @@ -1689,8 +1689,6 @@ correct order, and that your priority scheme will be respected. \label{AllowMixedPriority} \item [Allow Mixed Priority = \lt{}yes|no\gt{}] \index[dir]{Allow Mixed Priority} -\index[dir]{Directive|Allow Mixed Priority} - This directive is only implemented in version 2.5 and later. When set to {\bf yes} (default {\bf no}), this job may run even if lower priority jobs are already running. This means a high priority job diff --git a/docs/manuals/en/install/install.kilepr b/docs/manuals/en/install/install.kilepr index 72682b17..8d85c0f5 100644 --- a/docs/manuals/en/install/install.kilepr +++ b/docs/manuals/en/install/install.kilepr @@ -93,8 +93,8 @@ column=30 encoding=UTF-8 highlight=LaTeX line=37 -open=false -order=-1 +open=true +order=0 [item:installation.tex] archive=true -- 2.39.5