/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2012 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.
return false;
}
- jcr->setJobStatus(JS_Running);
- dir_send_job_status(jcr);
+ jcr->sendJobStatus(JS_Running);
if (dev->VolCatInfo.VolCatName[0] == 0) {
Pmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n"));
stream_to_ascii(buf1, rec.Stream,rec.FileIndex),
rec.data_len);
- while (!write_record_to_block(dcr, &rec)) {
- Dmsg2(850, "!write_record_to_block data_len=%d rem=%d\n", rec.data_len,
- rec.remainder);
- if (!dcr->write_block_to_device()) {
- Dmsg2(90, "Got write_block_to_dev error on device %s. %s\n",
- dev->print_name(), dev->bstrerror());
- ok = false;
- break;
- }
- }
+ ok = dcr->write_record(&rec);
if (!ok) {
- Dmsg0(400, "Not OK\n");
+ Dmsg2(90, "Got write_block_to_dev error on device %s. %s\n",
+ dcr->dev->print_name(), dcr->dev->bstrerror());
break;
}
jcr->JobBytes += rec.data_len; /* increment bytes this job */
fd->fsend("3999 Failed append\n");
}
- /*
- * Don't use time_t for job_elapsed as time_t can be 32 or 64 bits,
- * and the subsequent Jmsg() editing will break
- */
- int32_t job_elapsed = time(NULL) - jcr->run_time;
-
- if (job_elapsed <= 0) {
- job_elapsed = 1;
- }
-
- Jmsg(dcr->jcr, M_INFO, 0, _("Job write elapsed time = %02d:%02d:%02d, Transfer rate = %s Bytes/second\n"),
- job_elapsed / 3600, job_elapsed % 3600 / 60, job_elapsed % 60,
- edit_uint64_with_suffix(jcr->JobBytes / job_elapsed, ec));
-
-
Dmsg1(200, "Write EOS label JobStatus=%c\n", jcr->JobStatus);
/*
}
}
-
if (!ok && !jcr->is_JobStatus(JS_Incomplete)) {
discard_data_spool(dcr);
} else {
if (ok) {
ok = dvd_close_job(dcr); /* do DVD cleanup if any */
}
+
+ /*
+ * Don't use time_t for job_elapsed as time_t can be 32 or 64 bits,
+ * and the subsequent Jmsg() editing will break
+ */
+ int32_t job_elapsed = time(NULL) - jcr->run_time;
+
+ if (job_elapsed <= 0) {
+ job_elapsed = 1;
+ }
+
+ Jmsg(dcr->jcr, M_INFO, 0, _("Elapsed time=%02d:%02d:%02d, Transfer rate=%s Bytes/second\n"),
+ job_elapsed / 3600, job_elapsed % 3600 / 60, job_elapsed % 60,
+ edit_uint64_with_suffix(jcr->JobBytes / job_elapsed, ec));
/*
* Release the device -- and send final Vol info to DIR
commit_attribute_spool(jcr);
}
- dir_send_job_status(jcr); /* update director */
+ jcr->sendJobStatus(); /* update director */
Dmsg1(100, "return from do_append_data() ok=%d\n", ok);
return ok;