static void do_extract(char *fname);
-static void record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec);
+static int record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec);
static DEVICE *dev = NULL;
static BFILE bfd;
{
fprintf(stderr,
"\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: bextract [-d debug_level] <bacula-archive> <directory-to-store-files>\n"
+"Usage: bextract <options> <bacula-archive-device-name> <directory-to-store-files>\n"
" -b <file> specify a bootstrap file\n"
" -c <file> specify a configuration file\n"
-" -dnn set debug level to nn\n"
+" -d <nn> set debug level to nn\n"
" -e <file> exclude list\n"
" -i <file> include list\n"
-" -V specify Volume names (separated by |)\n"
+" -V <volumes> specify Volume names (separated by |)\n"
" -? print this message\n\n");
exit(1);
}
init_include_exclude_files(ff);
binit(&bfd);
- while ((ch = getopt(argc, argv, "b:c:d:e:i:?")) != -1) {
+ while ((ch = getopt(argc, argv, "b:c:d:e:i:V:?")) != -1) {
switch (ch) {
case 'b': /* bootstrap file */
bsr = parse_bsr(NULL, optarg);
-// dump_bsr(bsr);
+// dump_bsr(bsr, true);
break;
case 'c': /* specify config file */
/*
* Called here for each record from read_records()
*/
-static void record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
+static int record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
{
int stat;
if (rec->FileIndex < 0) {
- return; /* we don't want labels */
+ return 1; /* we don't want labels */
}
/* File Attributes stream */
stream_to_ascii(attr->data_stream));
}
extract = FALSE;
- return;
+ return 1;
}
Emsg3(M_ERROR, 0, _("Seek to %s error on %s: ERR=%s\n"),
edit_uint64(fileAddr, ec1), attr->ofname, berror(&bfd));
extract = FALSE;
- return;
+ return 1;
}
}
} else {
(const Bytef *)wbuf, (uLong)wsize) != Z_OK)) {
Emsg1(M_ERROR, 0, _("Uncompression error. ERR=%d\n"), stat);
extract = FALSE;
- return;
+ return 1;
}
Dmsg2(100, "Write uncompressed %d bytes, total before write=%d\n", compress_len, total);
Emsg2(M_ERROR, 0, _("Write error on %s: %s\n"),
attr->ofname, strerror(errno));
extract = FALSE;
- return;
+ return 1;
}
total += compress_len;
fileAddr += compress_len;
if (extract) {
Emsg0(M_ERROR, 0, "GZIP data stream found, but GZIP not configured!\n");
extract = FALSE;
- return;
+ return 1;
}
#endif
break;
break;
} /* end switch */
+ return 1;
}
/* Dummies to replace askdir.c */
int dir_get_volume_info(JCR *jcr, enum get_vol_info_rw writing) { return 1;}
int dir_find_next_appendable_volume(JCR *jcr) { return 1;}
-int dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel) { return 1; }
+int dir_update_volume_info(JCR *jcr, DEVICE *dev, int relabel) { return 1; }
int dir_create_jobmedia_record(JCR *jcr) { return 1; }
int dir_ask_sysop_to_mount_next_volume(JCR *jcr, DEVICE *dev) { return 1; }
int dir_update_file_attributes(JCR *jcr, DEV_RECORD *rec) { return 1;}