static bRC endRestoreFile(bpContext *ctx);
static bRC createFile(bpContext *ctx, struct restore_pkt *rp);
static bRC setFileAttributes(bpContext *ctx, struct restore_pkt *rp);
-static bRC checkFile(bpContext *ctx, char *fname);
+// Not used! static bRC checkFile(bpContext *ctx, char *fname);
static bRC handleXACLdata(bpContext *ctx, struct xacl_pkt *xacl);
/* Pointers to Bacula functions */
pluginIO,
createFile,
setFileAttributes,
- checkFile,
+ NULL,
handleXACLdata
};
accurate_warning(false),
local_restore(false),
backup_finish(false),
- unsupportedfeature(false),
+ unsupportedlevel(false),
param_notrunc(false),
errortar(false),
volumewarning(false),
/* the plugin support a FULL backup only as Docker does not support other levels */
mode = DOCKER_BACKUP_FULL;
if (lvl != 'F'){
- unsupportedfeature = true;
+ unsupportedlevel = true;
}
break;
/* Plugin command e.g. plugin = <plugin-name>:parameters */
case bEventPluginCommand:
- // Check supported level
- if (isourplugincommand(PLUGINPREFIX, (char*)value) && unsupportedfeature){
- DMSG0(ctx, DERROR, "Unsupported backup level. Doing FULL backup.\n");
- JMSG0(ctx, M_ERROR, "Unsupported backup level. Doing FULL backup.\n");
- /* single error message is enough */
- unsupportedfeature = false;
- }
DMSG_EVENT_STR(event, value);
+ if (isourplugincommand(PLUGINPREFIX, (char*)value)){
+ // Check supported level
+ if (unsupportedlevel){
+ DMSG0(ctx, DERROR, "Unsupported backup level. Doing FULL backup.\n");
+ JMSG0(ctx, M_ERROR, "Unsupported backup level. Doing FULL backup.\n");
+ /* single error message is enough */
+ unsupportedlevel = false;
+ }
+
+ // check accurate mode backup
+ int accurate;
+ getBaculaVar(bVarAccurate, &accurate);
+ DMSG(ctx, DINFO, "Accurate=%d\n", accurate);
+ if (accurate > 0 && !accurate_warning){
+ DMSG0(ctx, DERROR, "Accurate mode is not supported. Please disable Accurate mode for this job.\n");
+ JMSG0(ctx, M_WARNING, "Accurate mode is not supported. Please disable Accurate mode for this job.\n");
+ /* single error message is enough */
+ accurate_warning = true;
+ }
+ }
break;
case bEventOptionPlugin:
"... command into the Include {} block.\n");
return bRC_Error;
}
- return bRC_OK;
+ break;
case bEventEndFileSet:
DMSG_EVENT_STR(event, value);
return bRC_OK;
}
+#if 0
/*
* Unimplemented, always return bRC_Seen.
*/
}
return bRC_Seen;
}
+#endif
/*
* We will not generate any acl/xattr data, always return bRC_OK.
return self->createFile(ctx, rp);
}
+#if 0
/*
* checkFile used for accurate mode backup
*/
DOCKER *self = pluginclass(ctx);
return self->checkFile(ctx, fname);
}
+#endif
/*
* Called after the file has been restored. This can be used to
/* Plugin Info definitions */
#define DOCKER_LICENSE "Bacula AGPLv3"
#define DOCKER_AUTHOR "Radoslaw Korzeniewski"
-#define DOCKER_DATE "Oct 2019"
-#define DOCKER_VERSION "1.2.0"
+#define DOCKER_DATE "Jan 2020"
+#define DOCKER_VERSION "1.2.1"
#define DOCKER_DESCRIPTION "Bacula Docker Plugin"
/* Plugin compile time variables */
bRC pluginIO(bpContext *ctx, struct io_pkt *io);
bRC createFile(bpContext *ctx, struct restore_pkt *rp);
bRC setFileAttributes(bpContext *ctx, struct restore_pkt *rp);
- bRC checkFile(bpContext *ctx, char *fname);
+// Not used! bRC checkFile(bpContext *ctx, char *fname);
bRC handleXACLdata(bpContext *ctx, struct xacl_pkt *xacl);
void setworkingdir(char *workdir);
DOCKER(bpContext *bpctx);
bool accurate_warning; /* for sending accurate mode warning once */
bool local_restore; /* if where parameter is set to local path then make a local restore */
bool backup_finish; /* the hack to force finish backup list */
- bool unsupportedfeature; /* this flag show if plugin should report unsupported feature like unsupported backup level*/
+ bool unsupportedlevel; /* this flag show if plugin should report unsupported backup level */
bool param_notrunc; /* when "notrunc" option specified, used in listing mode only */
bool errortar; /* show if container tar for volume archive had errors */
bool volumewarning; /* when set then a warning about remote docker volume restore was sent to user */