*
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2003 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
exit(1);
}
- jcr = setup_jcr("btape", argv[0], bsr);
+ jcr = setup_jcr("btape", argv[0], bsr, NULL);
dev = setup_to_access_device(jcr, 0); /* acquire for write */
if (!dev) {
exit(1);
* subroutine.
*/
Dmsg0(100, "just before acquire_device\n");
- if (!acquire_device_for_append(jcr, dev, block)) {
- jcr->JobStatus = JS_Cancelled;
+ if (!(dev=acquire_device_for_append(jcr, dev, block))) {
+ set_jcr_job_status(jcr, JS_ErrorTerminated);
free_block(block);
return;
}
* Write Begin Session Record
*/
if (!write_session_label(jcr, block, SOS_LABEL)) {
- jcr->JobStatus = JS_Cancelled;
+ set_jcr_job_status(jcr, JS_ErrorTerminated);
Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"),
strerror_dev(dev));
ok = FALSE;
Dmsg0(000, "Write_end_session_label()\n");
/* Create Job status for end of session label */
if (!job_cancelled(jcr) && ok) {
- jcr->JobStatus = JS_Terminated;
+ set_jcr_job_status(jcr, JS_Terminated);
} else if (!ok) {
- jcr->JobStatus = JS_ErrorTerminated;
+ set_jcr_job_status(jcr, JS_ErrorTerminated);
}
if (!write_session_label(jcr, block, EOS_LABEL)) {
Pmsg1(000, _("Error writting end session label. ERR=%s\n"), strerror_dev(dev));
{"cap", capcmd, "list device capabilities"},
{"clear", clearcmd, "clear tape errors"},
{"eod", eodcmd, "go to end of Bacula data for append"},
- {"test", testcmd, "General test Bacula tape functions"},
{"eom", eomcmd, "go to the physical end of medium"},
{"fill", fillcmd, "fill tape, write onto second volume"},
{"unfill", unfillcmd, "read filled tape"},
{"rewind", rewindcmd, "rewind the tape"},
{"scan", scancmd, "read tape block by block to EOT and report"},
{"status", statcmd, "print tape status"},
+ {"test", testcmd, "General test Bacula tape functions"},
{"weof", weofcmd, "write an EOF on the tape"},
{"wr", wrcmd, "write a single record of 2048 bytes"},
};
static void usage()
{
fprintf(stderr, _(
-"\nVersion: " VERSION " (" DATE ")\n\n"
+"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: btape [-c config_file] [-d debug_level] [device_name]\n"
" -c <file> set configuration file to file\n"
" -dnn set debug level to nn\n"