<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Normal vs Command Plugins</TITLE> <META NAME="description" CONTENT="Normal vs Command Plugins"> <META NAME="keywords" CONTENT="developers"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="developers.css"> <LINK REL="next" HREF="Loading_Plugins.html"> <LINK REL="previous" HREF="Bacula_FD_Plugin_API.html"> <LINK REL="up" HREF="Bacula_FD_Plugin_API.html"> <LINK REL="next" HREF="Loading_Plugins.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html656" HREF="Loading_Plugins.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html650" HREF="Bacula_FD_Plugin_API.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html644" HREF="Bacula_FD_Plugin_API.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html652" HREF="Contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html654" HREF="GNU_Free_Documentation_Lice.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html657" HREF="Loading_Plugins.html">Loading Plugins</A> <B> Up:</B> <A NAME="tex2html651" HREF="Bacula_FD_Plugin_API.html">Bacula FD Plugin API</A> <B> Previous:</B> <A NAME="tex2html645" HREF="Bacula_FD_Plugin_API.html">Bacula FD Plugin API</A> <B> <A NAME="tex2html653" HREF="Contents.html">Contents</A></B> <B> <A NAME="tex2html655" HREF="GNU_Free_Documentation_Lice.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION00410000000000000000"> Normal vs Command Plugins</A> </H1> 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 <B>RunScript</B> 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. <P> 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. <P> 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: <P> <PRE> Plugin = <command-string> </PRE> <P> 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. <P> The important features of the command plugin entry points are: <UL> <LI>It is triggered by a "Plugin =" directive in the FileSet </LI> <LI>Only a single plugin is called that is named on the "Plugin =" directive. </LI> <LI>The full command string after the "Plugin =" is passed to the plugin so that it can be told what to backup/restore. </LI> </UL> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html656" HREF="Loading_Plugins.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html650" HREF="Bacula_FD_Plugin_API.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html644" HREF="Bacula_FD_Plugin_API.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html652" HREF="Contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html654" HREF="GNU_Free_Documentation_Lice.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html657" HREF="Loading_Plugins.html">Loading Plugins</A> <B> Up:</B> <A NAME="tex2html651" HREF="Bacula_FD_Plugin_API.html">Bacula FD Plugin API</A> <B> Previous:</B> <A NAME="tex2html645" HREF="Bacula_FD_Plugin_API.html">Bacula FD Plugin API</A> <B> <A NAME="tex2html653" HREF="Contents.html">Contents</A></B> <B> <A NAME="tex2html655" HREF="GNU_Free_Documentation_Lice.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> 2010-06-14 </ADDRESS> </BODY> </HTML>