/*
Bacula® - The Network Backup Solution
- Copyright (C) 2006-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2006-2009 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.
char ec1[50];
DEVICE *dev;
- switch(jcr->get_JobType()) {
+ switch(jcr->getJobType()) {
case JT_MIGRATE:
Type = "Migration";
break;
}
Dmsg2(100, "read_dcr=%p write_dcr=%p\n", jcr->read_dcr, jcr->dcr);
-
- create_restore_volume_list(jcr);
if (jcr->NumReadVolumes == 0) {
Jmsg(jcr, M_FATAL, 0, _("No Volume names found for %s.\n"), Type);
goto bail_out;
}
}
- free_restore_volume_list(jcr);
-
dir_send_job_status(jcr); /* update director */
-
Dmsg0(30, "Done reading.\n");
jcr->end_time = time(NULL);
dequeue_messages(jcr); /* send any queued messages */
}
generate_daemon_event(jcr, "JobEnd");
dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles,
- edit_uint64(jcr->JobBytes, ec1));
+ edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors);
Dmsg4(100, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, ec1);
dir->signal(BNET_EOD); /* send EOD to Director daemon */
case EOM_LABEL:
return true; /* don't write vol labels */
}
- if (jcr->get_JobType() == JT_BACKUP) {
+// if (jcr->getJobType() == JT_BACKUP) {
/*
* For normal migration jobs, FileIndex values are sequential because
* we are dealing with one job. However, for Vbackup (consolidation),
* We do so by detecting a FileIndex change and incrementing the
* JobFiles, which we then use as the output FileIndex.
*/
- if (rec->FileIndex > 0) {
+ if (rec->FileIndex >= 0) {
/* If something changed, increment FileIndex */
if (rec->VolSessionId != rec->last_VolSessionId ||
rec->VolSessionTime != rec->last_VolSessionTime ||
}
rec->FileIndex = jcr->JobFiles; /* set sequential output FileIndex */
}
- }
+// }
/*
* Modify record SessionId and SessionTime to correspond to
* output.
}
Dmsg2(200, "===== Wrote block new pos %u:%u\n", dev->file, dev->block_num);
}
- jcr->JobBytes += rec->data_len; /* increment bytes this job */
- if (rec->FileIndex <= 0) {
+ /* Restore packet */
+ rec->VolSessionId = rec->last_VolSessionId;
+ rec->VolSessionTime = rec->last_VolSessionTime;
+ if (rec->FileIndex < 0) {
return true; /* don't send LABELs to Dir */
}
+ jcr->JobBytes += rec->data_len; /* increment bytes this job */
Dmsg5(500, "wrote_record JobId=%d FI=%s SessId=%d Strm=%s len=%d\n",
jcr->JobId,
FI_to_ascii(buf1, rec->FileIndex), rec->VolSessionId,