JOBMEDIA_ITEM *item;
bool ok = true;;
- if (!dcr->WroteVol) {
+ if (!zero && !dcr->WroteVol) {
return true;
}
- if (dcr->VolLastIndex == 0) {
+ if (!zero && dcr->VolLastIndex == 0) {
Dmsg7(dbglvl, "JobMedia Vol=%s wrote=%d MediaId=%d FI=%d LI=%d StartBlock=%d EndBlock=%d Suppressed\n",
dcr->VolumeName, dcr->WroteVol, dcr->VolMediaId,
dcr->VolFirstIndex, dcr->VolLastIndex, dcr->StartBlock, dcr->EndBlock);
return true; /* nothing written to the Volume */
}
- if (dcr->StartFile == dcr->EndFile && dcr->EndBlock < dcr->StartBlock) {
- Dmsg7(0/*dbglvl*/, "PROBLEM Vol=%s wrote=%d MediaId=%d FI=%d LI=%d StartBlock=%d EndBlock=%d Suppressed\n",
+ if (!zero && dcr->StartFile == dcr->EndFile && dcr->EndBlock < dcr->StartBlock) {
+ Dmsg7(dbglvl, "JobMedia Vol=%s wrote=%d MediaId=%d FI=%d LI=%d StartBlock=%d EndBlock=%d Suppressed\n",
dcr->VolumeName, dcr->WroteVol, dcr->VolMediaId,
dcr->VolFirstIndex, dcr->VolLastIndex, dcr->StartBlock, dcr->EndBlock);
return true;
Dmsg0(100, "Canceled\n");
return false;
}
- /* Create a jobmedia record for this job */
- if (!dir_create_jobmedia_record(dcr)) {
+ /* If we wrote on Volume create a last jobmedia record for this job */
+ if (dcr->VolFirstIndex && !dir_create_jobmedia_record(dcr)) {
dcr->dev->dev_errno = EIO;
Jmsg2(jcr, M_FATAL, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
dcr->getVolCatName(), jcr->Job);