Jmsg(jcr, msg_type, 0, _("VSS Writer (BackupComplete): %s\n"), g_pVSSClient->GetWriterInfo(i));
}
}
+ WCHAR *metadata = g_pVSSClient->GetMetadata();
+ FF_PKT *ff_pkt = jcr->ff;
+ ff_pkt->fname = bstrdup("job_metadata.xml");
+ ff_pkt->type = FT_RESTORE_FIRST;
+ ff_pkt->LinkFI = 0;
+ ff_pkt->object = (char *)metadata;
+ ff_pkt->object_len = (wcslen(metadata) + 1) * sizeof(WCHAR);
+ save_file(jcr, ff_pkt, true);
}
#endif
}
dir->signal(BNET_TERMINATE);
free_plugins(jcr); /* release instantiated plugins */
+ free_and_null_pool_memory(jcr->job_metadata);
/* Clean up fileset */
FF_PKT *ff = jcr->ff;
return dir->fsend(OKRunScript);
}
-
static int restore_object_cmd(JCR *jcr)
{
BSOCK *dir = jcr->dir_bsock;
rop.object = dir->msg;
// Dmsg2(000, "Recv Object: len=%d Object=%s\n", dir->msglen, dir->msg);
- /* pass to plugin */
- generate_plugin_event(jcr, bEventRestoreObject, (void *)&rop);
+ if (strcmp(rop.object_name, "job_metadata.xml") == 0) {
+ Dmsg0(000, "got job metadata\n");
+ free_and_null_pool_memory(jcr->job_metadata);
+ jcr->job_metadata = rop.object;
+ rop.object = NULL;
+ } else {
+ /* pass to plugin */
+ generate_plugin_event(jcr, bEventRestoreObject, (void *)&rop);
+ }
if (rop.object_name) {
free(rop.object_name);
#if defined(WIN32_VSS)
/* START VSS ON WIN32 */
if (jcr->VSS) {
- if (g_pVSSClient->InitializeForRestore(jcr, vss_restore_init_callback)) {
+ if (g_pVSSClient->InitializeForRestore(jcr, vss_restore_init_callback,
+ (WCHAR *)jcr->job_metadata)) {
/* inform user about writer states */
int i;
for (i=0; i < (int)g_pVSSClient->GetWriterCount(); i++) {
berrno be;
Jmsg(jcr, M_WARNING, 0, _("VSS was not initialized properly. VSS support is disabled. ERR=%s\n"), be.bstrerror());
}
+ free_and_null_pool_memory(jcr->job_metadata);
run_scripts(jcr, jcr->RunScripts, "ClientAfterVSS");
}
#endif
/* File Daemon specific part of JCR */
uint32_t num_files_examined; /* files examined this job */
POOLMEM *last_fname; /* last file saved/verified */
+ POOLMEM *job_metadata; /* VSS job metadata */
acl_data_t *acl_data; /* ACLs for backup/restore */
xattr_data_t *xattr_data; /* Extended Attributes for backup/restore */
int32_t last_type; /* type of last file saved/verified */