/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-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.
#include "findlib/find.h"
/* Commands sent to File daemon */
-static char verifycmd[] = "verify level=%s\n";
-static char storaddr[] = "storage address=%s port=%d ssl=0\n";
+static char verifycmd[] = "verify level=%s\n";
+static char storaddr[] = "storage address=%s port=%d ssl=0 Authorization=%s\n";
/* Responses received from File daemon */
-static char OKverify[] = "2000 OK verify\n";
-static char OKstore[] = "2000 OK storage\n";
-static char OKbootstrap[] = "2000 OK bootstrap\n";
+static char OKverify[] = "2000 OK verify\n";
+static char OKstore[] = "2000 OK storage\n";
+
+/* Responses received from the Storage daemon */
+static char OKbootstrap[] = "3000 OK bootstrap\n";
/* Forward referenced functions */
static void prt_fname(JCR *jcr);
db_strerror(jcr->db));
return false;
}
- if (jcr->previous_jr.JobStatus != 'T') {
+ if (!(jcr->previous_jr.JobStatus == JS_Terminated ||
+ jcr->previous_jr.JobStatus == JS_Warnings)) {
Jmsg(jcr, M_FATAL, 0, _("Last Job %d did not terminate normally. JobStatus=%c\n"),
verify_jobid, jcr->previous_jr.JobStatus);
return false;
* File daemon but not used).
*/
if (jcr->get_JobLevel() == L_VERIFY_VOLUME_TO_CATALOG) {
- if (!create_restore_bootstrap_file(jcr)) {
+ int stat;
+ /*
+ * Note: negative status is an error, zero status, means
+ * no files were backed up, so skip calling SD and
+ * client.
+ */
+ stat = create_restore_bootstrap_file(jcr);
+ if (stat < 0) { /* error */
return false;
+ } else if (stat == 0) { /* No files, nothing to do */
+ verify_cleanup(jcr, JS_Terminated); /* clean up */
+ return true; /* get out */
}
} else {
jcr->sd_auth_key = bstrdup("dummy"); /* dummy Storage daemon key */
edit_uint64(jcr->JobId, ed1), level_to_str(jcr->get_JobLevel()), jcr->Job);
if (jcr->get_JobLevel() == L_VERIFY_VOLUME_TO_CATALOG) {
+ BSOCK *sd;
/*
* Start conversation with Storage daemon
*/
if (!start_storage_daemon_job(jcr, jcr->rstorage, NULL)) {
return false;
}
- if (!jcr->store_bsock->fsend("run")) {
+ sd = jcr->store_bsock;
+ /*
+ * Send the bootstrap file -- what Volumes/files to restore
+ */
+ if (!send_bootstrap_file(jcr, sd) ||
+ !response(jcr, sd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) {
+ goto bail_out;
+ }
+ if (!sd->fsend("run")) {
return false;
}
/*
if (jcr->rstore->SDDport == 0) {
jcr->rstore->SDDport = jcr->rstore->SDport;
}
- bnet_fsend(fd, storaddr, jcr->rstore->address, jcr->rstore->SDDport);
+ bnet_fsend(fd, storaddr, jcr->rstore->address,
+ jcr->rstore->SDDport, jcr->sd_auth_key);
if (!response(jcr, fd, OKstore, "Storage", DISPLAY_ERROR)) {
goto bail_out;
}
- /*
- * Send the bootstrap file -- what Volumes/files to restore
- */
- if (!send_bootstrap_file(jcr, fd) ||
- !response(jcr, fd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) {
- goto bail_out;
- }
-
if (!jcr->RestoreBootstrap) {
Jmsg0(jcr, M_FATAL, 0, _("Deprecated feature ... use bootstrap.\n"));
goto bail_out;
edt,
edit_uint64_with_commas(jcr->ExpectedFiles, ec1),
edit_uint64_with_commas(jcr->JobFiles, ec2),
- jcr->Errors,
+ jcr->JobErrors,
fd_term_msg,
sd_term_msg,
term_msg);
sdt,
edt,
edit_uint64_with_commas(jcr->JobFiles, ec1),
- jcr->Errors,
+ jcr->JobErrors,
fd_term_msg,
term_msg);
}
jcr->fn_printed = false;
bsnprintf(buf, sizeof(buf),
"SELECT Path.Path,Filename.Name FROM File,Path,Filename "
- "WHERE File.JobId=%d "
+ "WHERE File.JobId=%d AND File.FileIndex > 0 "
"AND File.MarkId!=%d AND File.PathId=Path.PathId "
"AND File.FilenameId=Filename.FilenameId",
JobId, jcr->JobId);