- if (jcr->JobLevel == L_VERIFY_CATALOG || jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
- memcpy(&jr, &(jcr->jr), sizeof(jr));
- if (!db_find_last_jobid(jcr, jcr->db, &jr)) {
- Jmsg(jcr, M_FATAL, 0, _(
- "Unable to find JobId of previous InitCatalog Job.\n"
- "Please run a Verify with Level=InitCatalog before\n"
- "running the current Job.\n"));
+ if (jcr->JobLevel == L_VERIFY_CATALOG ||
+ jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ||
+ jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG) {
+ memcpy(&jr, &jcr->jr, sizeof(jr));
+ if (jcr->job->verify_job &&
+ (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ||
+ jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG)) {
+ Name = jcr->job->verify_job->hdr.name;
+ } else {
+ Name = NULL;
+ }
+ Dmsg1(100, "find last jobid for: %s\n", NPRT(Name));
+ if (!db_find_last_jobid(jcr, jcr->db, Name, &jr)) {
+ if (jcr->JobLevel == L_VERIFY_CATALOG) {
+ Jmsg(jcr, M_FATAL, 0, _(
+ "Unable to find JobId of previous InitCatalog Job.\n"
+ "Please run a Verify with Level=InitCatalog before\n"
+ "running the current Job.\n"));
+ } else {
+ Jmsg(jcr, M_FATAL, 0, _(
+ "Unable to find JobId of previous Job for this client.\n"));
+ }