static void usage()
{
fprintf(stderr,
-"\nVersion: " VERSION " (" DATE ")\n\n"
+"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: bls [-d debug_level] <physical-device-name>\n"
" -b <file> specify a bootstrap file\n"
" -c <file> specify a config file\n"
" -i <file> include list\n"
" -j list jobs\n"
" -k list blocks\n"
-" -L list tape label\n"
" (none of above) list saved files\n"
" -v be verbose\n"
+" -V specify Volume names (separated by |)\n"
" -? print this message\n\n");
exit(1);
}
int i, ch;
FILE *fd;
char line[1000];
+ char *VolumeName= NULL;
+ char *bsrName = NULL;
working_directory = "/tmp";
my_name_is(argc, argv, "bls");
memset(&ff, 0, sizeof(ff));
init_include_exclude_files(&ff);
- while ((ch = getopt(argc, argv, "b:c:d:e:i:jkLtv?")) != -1) {
+ while ((ch = getopt(argc, argv, "b:c:d:e:i:jkLtvV:?")) != -1) {
switch (ch) {
case 'b':
- bsr = parse_bsr(NULL, optarg);
-// dump_bsr(bsr);
+ bsrName = optarg;
break;
case 'c': /* specify config file */
verbose++;
break;
+ case 'V': /* Volume name */
+ VolumeName = optarg;
+ break;
+
case '?':
default:
usage();
argv += optind;
if (!argc) {
- Pmsg0(0, "No archive name specified\n");
+ Pmsg0(0, _("No archive name specified\n"));
usage();
}
parse_config(configfile);
-
if (ff.included_files_list == NULL) {
add_fname_to_include_list(&ff, 0, "/");
}
for (i=0; i < argc; i++) {
- jcr = setup_jcr("bls", argv[i], bsr);
+ if (bsrName) {
+ bsr = parse_bsr(NULL, bsrName);
+ }
+ jcr = setup_jcr("bls", argv[i], bsr, VolumeName);
dev = setup_to_access_device(jcr, 1); /* acquire for read */
if (!dev) {
exit(1);
dump_volume_label(dev);
return;
}
-
read_records(jcr, dev, record_cb, mount_next_read_volume);
printf("%u files found.\n", num_files);
}
/* File Attributes stream */
if (rec->Stream == STREAM_UNIX_ATTRIBUTES || rec->Stream == STREAM_WIN32_ATTRIBUTES) {
char *ap, *fp;
+ uint32_t LinkFI;
+
sscanf(rec->data, "%ld %d", &record_file_index, &type);
if (record_file_index != rec->FileIndex) {
Emsg2(M_ERROR_TERM, 0, "Record header file index %ld not equal record index %ld\n",
}
*fp = *ap++; /* terminate filename & point to attribs */
- decode_stat(ap, &statp);
+ decode_stat(ap, &statp, &LinkFI);
/* Skip to link name */
while (*ap++ != 0)
;