1 This patch should fix the problem reported in bug #803 where a Verify
2 job select the JobId to verified at schedule time rather than at runtime.
3 This makes it difficult or impossible to schedule a verify just after
6 Apply this patch to Bacula version 2.0.3 (probably 2.0.2 as well) with:
9 patch -p0 <2.0.3-verify.patch
14 Index: src/dird/verify.c
15 ===================================================================
16 --- src/dird/verify.c (revision 4353)
17 +++ src/dird/verify.c (working copy)
21 - * Bacula Director -- verify.c -- responsible for running file verification
23 - * Kern Sibbald, October MM
25 - * Basic tasks done here:
27 - * Open connection with File daemon and pass him commands
29 - * When the File daemon sends the attributes, compare them to
30 - * what is in the DB.
35 Bacula® - The Network Backup Solution
37 - Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
38 + Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
40 The main author of Bacula is Kern Sibbald, with contributions from
41 many others, a complete list can be found in the file AUTHORS.
43 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
44 Switzerland, email:ftf@fsfeurope.org.
48 + * Bacula Director -- verify.c -- responsible for running file verification
50 + * Kern Sibbald, October MM
52 + * Basic tasks done here:
54 + * Open connection with File daemon and pass him commands
56 + * When the File daemon sends the attributes, compare them to
57 + * what is in the DB.
66 bool do_verify_init(JCR *jcr)
73 + * Do a verification of the specified files against the Catlaog
75 + * Returns: false on failure
78 +bool do_verify(JCR *jcr)
85 JobId_t verify_jobid = 0;
89 memset(&jcr->previous_jr, 0, sizeof(jcr->previous_jr));
91 - Dmsg1(9, "bdird: created client %s record\n", jcr->client->hdr.name);
94 - * Find JobId of last job that ran. E.g.
95 - * for VERIFY_CATALOG we want the JobId of the last INIT.
96 - * for VERIFY_VOLUME_TO_CATALOG, we want the JobId of the
97 + * Find JobId of last job that ran. Note, we do this when
98 + * the job actually starts running, not at schedule time,
99 + * so that we find the last job that terminated before
100 + * this job runs rather than before it is scheduled. This
101 + * permits scheduling a Backup and Verify at the same time,
102 + * but with the Verify at a lower priority.
104 + * For VERIFY_CATALOG we want the JobId of the last INIT.
105 + * For VERIFY_VOLUME_TO_CATALOG, we want the JobId of the
108 if (jcr->JobLevel == L_VERIFY_CATALOG ||
110 if (jcr->verify_job &&
111 (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ||
112 jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG)) {
113 - Name = jcr->verify_job->hdr.name;
114 + Name = jcr->verify_job->name();
119 jcr->fileset = jcr->verify_job->fileset;
121 Dmsg2(100, "ClientId=%u JobLevel=%c\n", jcr->previous_jr.ClientId, jcr->JobLevel);
127 - * Do a verification of the specified files against the Catlaog
129 - * Returns: false on failure
132 -bool do_verify(JCR *jcr)
139 if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
140 Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));