Kern's ToDo List
- 25 October 2002
+ 29 October 2002
To do:
- Document that two Verifys at same time on same client do not work.
ANYTHING to and from a Bacula Volume, including horrible
stuff like Windows ACLs).
+- Write bcopy program.
- Preprocessing command per file.
- Postprocessing command per file (when restoring).
- File system type from File daemon
- Send Volumes needed during restore to Console (just after
create_volume_list) -- also in restore command?
- Document buffer size considerations with Sparse files --
-- Document all daemon tools MUST have a config file.
- Move block size code from block.c to init_dev().
- Add code to fast seek to proper place on tape/file
when doing Restore. If it doesn't work, try linear
search as before.
- Add code to reject whole blocks if not wanted on restore.
-- Why does btape error when pointed to a file?
- Possibly add email to Watchdog if drive is unmounted too
long and a job is waiting on the drive.
-- Disallow compile if long long not 64 bits.
- What to do with btime and JobTDate?
- Add FileSet MD5 to bscan.
- Finish implementation of restore "replace" options, and document.
- Label (asks for slot, return and it stops).
- Make SD reject writing on tape where Catalog and tape # files
don't agree (possibly OK if tape > catalog).
+- Document all daemon tools MUST have a config file.
+- Why does btape error when pointed to a file?
+- Disallow compile if long long not 64 bits.
static void eomcmd()
{
if (!eod_dev(dev)) {
- Pmsg1(0, "Bad status from eod. ERR=%s\n", strerror_dev(dev));
+ Pmsg1(0, _("Bad status from eod. ERR=%s\n"), strerror_dev(dev));
return;
} else {
- Pmsg0(0, "Moved to end of media\n");
+ Pmsg0(0, _("Moved to end of media\n"));
}
}
int stat;
if ((stat=bsf_dev(dev, 1)) < 0) {
- Pmsg1(0, "Bad status from bsf. ERR=%s\n", strerror(errno));
+ Pmsg1(0, _("Bad status from bsf. ERR=%s\n"), strerror(errno));
} else {
- Pmsg0(0, "Back spaced one file.\n");
+ Pmsg0(0, _("Back spaced one file.\n"));
}
}
int stat;
if ((stat=bsr_dev(dev, 1)) < 0) {
- Pmsg1(0, "Bad status from bsr. ERR=%s\n", strerror(errno));
+ Pmsg1(0, _("Bad status from bsr. ERR=%s\n"), strerror(errno));
} else {
- Pmsg0(0, "Back spaced one record.\n");
+ Pmsg0(0, _("Back spaced one record.\n"));
}
}
*/
static void capcmd()
{
- Pmsg0(0, "Device capabilities: ");
+ printf(_("Device capabilities:\n"));
printf("%sEOF ", dev->capabilities & CAP_EOF ? "" : "!");
printf("%sBSR ", dev->capabilities & CAP_BSR ? "" : "!");
printf("%sBSF ", dev->capabilities & CAP_BSF ? "" : "!");
printf("%sANONVOLS ", dev->capabilities & CAP_ANONVOLS ? "" : "!");
printf("%sALWAYSOPEN ", dev->capabilities & CAP_ALWAYSOPEN ? "" : "!");
printf("\n");
+
+ printf(_("Device status:\n"));
+ printf("%sOPENED ", dev->state & ST_OPENED ? "" : "!");
+ printf("%sTAPE ", dev->state & ST_TAPE ? "" : "!");
+ printf("%sLABEL ", dev->state & ST_LABEL ? "" : "!");
+ printf("%sMALLOC ", dev->state & ST_MALLOC ? "" : "!");
+ printf("%sAPPEND ", dev->state & ST_APPEND ? "" : "!");
+ printf("%sREAD ", dev->state & ST_READ ? "" : "!");
+ printf("%sEOT ", dev->state & ST_EOT ? "" : "!");
+ printf("%sWEOT ", dev->state & ST_WEOT ? "" : "!");
+ printf("%sEOF ", dev->state & ST_EOF ? "" : "!");
+ printf("%sNEXTVOL ", dev->state & ST_NEXTVOL ? "" : "!");
+ printf("%sSHORT ", dev->state & ST_SHORT ? "" : "!");
+ printf("\n");
+
}
/*
break;
}
if (!found)
- Pmsg1(0, "%s is an illegal command\n", cmd);
+ Pmsg1(0, _("%s is an illegal command\n"), cmd);
if (quit)
break;
}
{
unsigned int i;
usage();
- printf(" Command Description\n ======= ===========\n");
+ printf(_(" Command Description\n ======= ===========\n"));
for (i=0; i<comsize; i++)
printf(" %-10s %s\n", commands[i].key, commands[i].help);
printf("\n");
static void usage()
{
- fprintf(stderr,
+ fprintf(stderr, _(
"\nVersion: " VERSION " (" DATE ")\n\n"
"Usage: btape [-c config_file] [-d debug_level] [device_name]\n"
" -c <file> set configuration file to file\n"
" -s turn off signals\n"
" -t open the default tape device\n"
" -? print this message.\n"
-"\n");
+"\n"));
}
if (read_access) {
if (!acquire_device_for_read(jcr, dev, block)) {
Emsg0(M_ERROR, 0, dev->errmsg);
+ free_block(block);
return NULL;
}
+ } else {
+ lock_device(dev);
+ if (!(dev->state & ST_OPENED)) {
+ Dmsg0(129, "Opening device.\n");
+ if (open_dev(dev, jcr->VolumeName, READ_WRITE) < 0) {
+ Emsg1(M_FATAL, 0, _("dev open failed: %s\n"), dev->errmsg);
+ unlock_device(dev);
+ free_block(block);
+ return NULL;
+ }
+ }
+ Dmsg1(129, "open_dev %s OK\n", dev_name(dev));
+ unlock_device(dev);
}
free_block(block);
return dev;
free_pool_memory(jcr->dev_name);
jcr->dev_name = NULL;
}
+ if (jcr->VolList) {
+ free_vol_list(jcr);
+ }
return;
}