/*
- Bacula® - The Network Backup Solution
+ Bacula(R) - The Network Backup Solution
+ Copyright (C) 2000-2015 Kern Sibbald
Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
- The main author of Bacula is Kern Sibbald, with contributions from many
- others, a complete list can be found in the file AUTHORS.
+ The original author of Bacula is Kern Sibbald, with contributions
+ from many others, a complete list can be found in the file AUTHORS.
You may use this file and others of this release according to the
license defined in the LICENSE file, which includes the Affero General
Public License, v3.0 ("AGPLv3") and some additional permissions and
terms pursuant to its AGPLv3 Section 7.
- Bacula® is a registered trademark of Kern Sibbald.
+ This notice must be preserved when any source code is
+ conveyed and/or propagated.
+
+ Bacula(R) is a registered trademark of Kern Sibbald.
*/
/*
* A simple test plugin for the Bacula File Daemon derived from
static const int dbglvl = 000;
-#define PLUGIN_LICENSE "Bacula AGPLv3"
+#define PLUGIN_LICENSE "AGPLv3"
#define PLUGIN_AUTHOR "Kern Sibbald"
#define PLUGIN_DATE "May 2011"
#define PLUGIN_VERSION "3"
{ "string2", ini_store_str, "2nd String", 0},
{ "ok", ini_store_bool, "boolean", 0},
-// We can also use the ITEMS_DEFAULT
+// We can also use the ITEMS_DEFAULT
// { "ok", ini_store_bool, "boolean", 0, ITEMS_DEFAULT},
{ NULL, NULL, NULL, 0}
};
}
/*
- * External entry point to unload the plugin
+ * External entry point to unload the plugin
*/
-bRC unloadPlugin()
+bRC unloadPlugin()
{
// printf("test-plugin-fd: Unloaded\n");
return bRC_OK;
}
/*
- * The following entry points are accessed through the function
+ * The following entry points are accessed through the function
* pointers we supplied to Bacula. Each plugin type (dir, fd, sd)
* has its own set of entry points that the plugin must define.
*/
/*
* Return some plugin value (none defined)
*/
-static bRC getPluginValue(bpContext *ctx, pVariable var, void *value)
+static bRC getPluginValue(bpContext *ctx, pVariable var, void *value)
{
return bRC_OK;
}
/*
* Set a plugin value (none defined)
*/
-static bRC setPluginValue(bpContext *ctx, pVariable var, void *value)
+static bRC setPluginValue(bpContext *ctx, pVariable var, void *value)
{
return bRC_OK;
}
break;
}
rop = (restore_object_pkt *)value;
- bfuncs->DebugMessage(ctx, fi, li, dbglvl,
+ bfuncs->DebugMessage(ctx, fi, li, dbglvl,
"Get RestoreObject len=%d JobId=%d oname=%s type=%d data=%.127s\n",
rop->object_len, rop->JobId, rop->object_name, rop->object_type,
rop->object);
}
ini.register_items(test_items, sizeof(struct ini_items));
if (ini.parse(ini.out_fname)) {
- bfuncs->JobMessage(ctx, fi, li, M_INFO, 0, "string1 = %s\n",
+ bfuncs->JobMessage(ctx, fi, li, M_INFO, 0, "string1 = %s\n",
ini.items[0].val.strval);
} else {
bfuncs->JobMessage(ctx, fi, li, M_ERROR, 0, "Can't parse config\n");
}
*p++ = 0; /* terminate reader string */
p_ctx->writer = p;
- printf("test-plugin-fd: plugin=%s fname=%s reader=%s writer=%s\n",
+ printf("test-plugin-fd: plugin=%s fname=%s reader=%s writer=%s\n",
p_ctx->cmd, p_ctx->fname, p_ctx->reader, p_ctx->writer);
break;
}
return bRC_OK;
}
-/*
+/*
* Start the backup of a specific file
*/
static bRC startBackupFile(bpContext *ctx, struct save_pkt *sp)
if (p_ctx->nb_obj == 0) {
sp->fname = (char *)"takeme.h";
- bfuncs->DebugMessage(ctx, fi, li, dbglvl, "AcceptFile=%s = %d\n",
+ bfuncs->DebugMessage(ctx, fi, li, dbglvl, "AcceptFile=%s = %d\n",
sp->fname, bfuncs->AcceptFile(ctx, sp));
sp->fname = (char *)"/path/to/excludeme.o";
- bfuncs->DebugMessage(ctx, fi, li, dbglvl, "AcceptFile=%s = %d\n",
+ bfuncs->DebugMessage(ctx, fi, li, dbglvl, "AcceptFile=%s = %d\n",
sp->fname, bfuncs->AcceptFile(ctx, sp));
sp->fname = (char *)"/path/to/excludeme.c";
- bfuncs->DebugMessage(ctx, fi, li, dbglvl, "AcceptFile=%s = %d\n",
+ bfuncs->DebugMessage(ctx, fi, li, dbglvl, "AcceptFile=%s = %d\n",
sp->fname, bfuncs->AcceptFile(ctx, sp));
}
fclose(fp);
}
free_pool_memory(q);
-
+
} else if (p_ctx->nb_obj == 1) {
ConfigFile ini;
p_ctx->buf = get_pool_memory(PM_BSOCK);
sp->type = FT_PLUGIN_CONFIG;
Dmsg1(0, "RestoreOptions=<%s>\n", p_ctx->buf);
- }
+ }
time_t now = time(NULL);
sp->index = ++p_ctx->nb_obj;
sp->statp.st_blksize = 4096;
sp->statp.st_blocks = 1;
bfuncs->DebugMessage(ctx, fi, li, dbglvl,
- "Creating RestoreObject len=%d oname=%s data=%.127s\n",
+ "Creating RestoreObject len=%d oname=%s data=%.127s\n",
sp->object_len, sp->object_name, sp->object);
printf("test-plugin-fd: startBackupFile\n");
if (!p_ctx) {
return bRC_Error;
}
-
+
io->status = 0;
io->io_errno = 0;
return bRC_OK;
/*
* This is called during restore to create the file (if necessary)
* We must return in rp->create_status:
- *
+ *
* CF_ERROR -- error
* CF_SKIP -- skip processing this file
* CF_EXTRACT -- extract the file (i.e.call i/o routines)