/*
Bacula® - The Network Backup Solution
- Copyright (C) 2008-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2008-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.
static const int dbglevel = 10;
-static char OKbootstrap[] = "3000 OK bootstrap\n";
-
static bool create_bootstrap_file(JCR *jcr, POOLMEM *jobids);
void vbackup_cleanup(JCR *jcr, int TermCode);
*/
bool do_vbackup_init(JCR *jcr)
{
- char *p;
if (!get_or_create_fileset_record(jcr)) {
Dmsg1(dbglevel, "JobId=%d no FileSet\n", (int)jcr->JobId);
Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
}
- POOLMEM *jobids = get_pool_memory(PM_FNAME);
- jcr->jr.JobLevel = L_VIRTUAL_FULL;
- db_accurate_get_jobids(jcr, jcr->db, &jcr->jr, jobids);
- jcr->jr.JobLevel = L_FULL;
- Dmsg1(10, "Accurate jobids=%s\n", jobids);
- if (*jobids == 0) {
- free_pool_memory(jobids);
- Jmsg(jcr, M_FATAL, 0, _("Cannot find previous JobIds.\n"));
- return false;
- }
-
- /*
- * Now we find the last job that ran and store it's info in
- * the previous_jr record. We will set our times to the
- * values from that job so that anything changed after that
- * time will be picked up on the next backup.
- */
- p = strrchr(jobids, ','); /* find last jobid */
- if (p != NULL) {
- p++;
- } else {
- p = jobids;
- }
- memset(&jcr->previous_jr, 0, sizeof(jcr->previous_jr));
- jcr->previous_jr.JobId = str_to_int64(p);
- if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) {
- Jmsg(jcr, M_FATAL, 0, _("Error getting Job record for previous Job: ERR=%s"),
- db_strerror(jcr->db));
- return false;
- }
-
- if (!create_bootstrap_file(jcr, jobids)) {
- Jmsg(jcr, M_FATAL, 0, _("Could not get or create the FileSet record.\n"));
- free_pool_memory(jobids);
- return false;
- }
- free_pool_memory(jobids);
/*
* If the original backup pool has a NextPool, make sure a
{
char ed1[100];
BSOCK *sd;
+ char *p;
Dmsg2(100, "rstorage=%p wstorage=%p\n", jcr->rstorage, jcr->wstorage);
Dmsg2(100, "Read store=%s, write store=%s\n",
_("This Job is not an Accurate backup so is not equivalent to a Full backup.\n"));
}
+ POOLMEM *jobids = get_pool_memory(PM_FNAME);
+ jcr->jr.JobLevel = L_VIRTUAL_FULL;
+ db_accurate_get_jobids(jcr, jcr->db, &jcr->jr, jobids);
+ jcr->jr.JobLevel = L_FULL;
+ Dmsg1(10, "Accurate jobids=%s\n", jobids);
+ if (*jobids == 0) {
+ free_pool_memory(jobids);
+ Jmsg(jcr, M_FATAL, 0, _("No previous Jobs found.\n"));
+ return false;
+ }
+
+ /*
+ * Now we find the last job that ran and store it's info in
+ * the previous_jr record. We will set our times to the
+ * values from that job so that anything changed after that
+ * time will be picked up on the next backup.
+ */
+ p = strrchr(jobids, ','); /* find last jobid */
+ if (p != NULL) {
+ p++;
+ } else {
+ p = jobids;
+ }
+ memset(&jcr->previous_jr, 0, sizeof(jcr->previous_jr));
+ jcr->previous_jr.JobId = str_to_int64(p);
+ Dmsg1(10, "Previous JobId=%s\n", p);
+ if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) {
+ Jmsg(jcr, M_FATAL, 0, _("Error getting Job record for previous Job: ERR=%s"),
+ db_strerror(jcr->db));
+ return false;
+ }
+
+ if (!create_bootstrap_file(jcr, jobids)) {
+ Jmsg(jcr, M_FATAL, 0, _("Could not get or create the FileSet record.\n"));
+ free_pool_memory(jobids);
+ return false;
+ }
+ free_pool_memory(jobids);
+
/*
* Open a message channel connection with the Storage
* daemon. This is to let him know that our client
/*
* Now start a job with the Storage daemon
*/
- if (!start_storage_daemon_job(jcr, jcr->rstorage, jcr->wstorage)) {
+ if (!start_storage_daemon_job(jcr, jcr->rstorage, jcr->wstorage, /*send_bsr*/true)) {
return false;
}
Dmsg0(100, "Storage daemon connection OK\n");
- if (!send_bootstrap_file(jcr, sd) ||
- !response(jcr, sd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) {
- return false;
- }
-
/*
* We re-update the job start record so that the start
* time is set after the run before job. This avoids
set_jcr_job_status(jcr, JS_Running);
/* Pickup Job termination data */
- /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/Errors */
+ /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/JobErrors */
wait_for_storage_daemon_termination(jcr);
set_jcr_job_status(jcr, jcr->SDJobStatus);
db_write_batch_file_records(jcr); /* used by bulk batch file insert */
switch (jcr->JobStatus) {
case JS_Terminated:
- if (jcr->Errors || jcr->SDErrors) {
+ if (jcr->JobErrors || jcr->SDErrors) {
term_msg = _("Backup OK -- with warnings");
} else {
term_msg = _("Backup OK");
}
jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg));
- Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n"
+ Jmsg(jcr, msg_type, 0, _("%s %s %s (%s): %s\n"
" Build OS: %s %s %s\n"
" JobId: %d\n"
" Job: %s\n"
" SD Errors: %d\n"
" SD termination status: %s\n"
" Termination: %s\n\n"),
- my_name, VERSION, LSMDATE, edt,
+ BACULA, my_name, VERSION, LSMDATE, edt,
HOST_OS, DISTNAME, DISTVER,
jcr->jr.JobId,
jcr->jr.Job,