-/*
- *
- * Bacula Director -- verify.c -- responsible for running file verification
- *
- * Kern Sibbald, October MM
- *
- * Basic tasks done here:
- * Open DB
- * Open connection with File daemon and pass him commands
- * to do the verify.
- * When the File daemon sends the attributes, compare them to
- * what is in the DB.
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2007 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.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ *
+ * Bacula Director -- verify.c -- responsible for running file verification
+ *
+ * Kern Sibbald, October MM
+ *
+ * Basic tasks done here:
+ * Open DB
+ * Open connection with File daemon and pass him commands
+ * to do the verify.
+ * When the File daemon sends the attributes, compare them to
+ * what is in the DB.
+ *
+ * Version $Id$
+ */
#include "bacula.h"
*/
bool do_verify_init(JCR *jcr)
{
+ return true;
+}
+
+
+/*
+ * Do a verification of the specified files against the Catlaog
+ *
+ * Returns: false on failure
+ * true on success
+ */
+bool do_verify(JCR *jcr)
+{
+ const char *level;
+ BSOCK *fd;
+ int stat;
+ char ed1[100];
JOB_DBR jr;
JobId_t verify_jobid = 0;
const char *Name;
memset(&jcr->previous_jr, 0, sizeof(jcr->previous_jr));
- Dmsg1(9, "bdird: created client %s record\n", jcr->client->hdr.name);
-
/*
- * Find JobId of last job that ran. E.g.
- * for VERIFY_CATALOG we want the JobId of the last INIT.
- * for VERIFY_VOLUME_TO_CATALOG, we want the JobId of the
+ * Find JobId of last job that ran. Note, we do this when
+ * the job actually starts running, not at schedule time,
+ * so that we find the last job that terminated before
+ * this job runs rather than before it is scheduled. This
+ * permits scheduling a Backup and Verify at the same time,
+ * but with the Verify at a lower priority.
+ *
+ * For VERIFY_CATALOG we want the JobId of the last INIT.
+ * For VERIFY_VOLUME_TO_CATALOG, we want the JobId of the
* last backup Job.
*/
if (jcr->JobLevel == L_VERIFY_CATALOG ||
if (jcr->verify_job &&
(jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ||
jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG)) {
- Name = jcr->verify_job->hdr.name;
+ Name = jcr->verify_job->name();
} else {
Name = NULL;
}
jcr->fileset = jcr->verify_job->fileset;
}
Dmsg2(100, "ClientId=%u JobLevel=%c\n", jcr->previous_jr.ClientId, jcr->JobLevel);
- return true;
-}
-
-
-/*
- * Do a verification of the specified files against the Catlaog
- *
- * Returns: false on failure
- * true on success
- */
-bool do_verify(JCR *jcr)
-{
- const char *level;
- BSOCK *fd;
- int stat;
- char ed1[100];
if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg));
if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg));
- Jmsg(jcr, msg_type, 0, _("Bacula %s (%s): %s\n"
+ Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n"
+" Build OS: %s %s %s\n"
" JobId: %d\n"
" Job: %s\n"
" FileSet: %s\n"
" FD termination status: %s\n"
" SD termination status: %s\n"
" Termination: %s\n\n"),
- VERSION,
- LSMDATE,
- edt,
+ my_name, VERSION, LSMDATE, edt,
+ HOST_OS, DISTNAME, DISTVER,
jcr->jr.JobId,
jcr->jr.Job,
jcr->fileset->hdr.name,
sd_term_msg,
term_msg);
} else {
- Jmsg(jcr, msg_type, 0, _("Bacula %s (%s): %s\n"
+ Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n"
+" Build: %s %s %s\n"
" JobId: %d\n"
" Job: %s\n"
" FileSet: %s\n"
" Non-fatal FD errors: %d\n"
" FD termination status: %s\n"
" Termination: %s\n\n"),
- VERSION,
- LSMDATE,
- edt,
+ my_name, VERSION, LSMDATE, edt,
+ HOST_OS, DISTNAME, DISTVER,
jcr->jr.JobId,
jcr->jr.Job,
jcr->fileset->hdr.name,