static void usage()
{
fprintf(stderr, _(
-"Copyright (C) 2001-2005 Kern Sibbald.\n"
+"Copyright (C) 2001-%s Kern Sibbald.\n"
"\nVersion: %s (%s)\n\n"
"Usage: bscan [ options ] <bacula-archive>\n"
" -b bootstrap specify a bootstrap file\n"
" -v verbose\n"
" -V <Volumes> specify Volume names (separated by |)\n"
" -w <dir> specify working directory (default from conf file)\n"
-" -? print this message\n\n"), VERSION, BDATE);
+" -? print this message\n\n"), BYEAR, VERSION, BDATE);
exit(1);
}
setlocale(LC_ALL, "");
bindtextdomain("bacula", LOCALEDIR);
textdomain("bacula");
+ init_stack_dump();
my_name_is(argc, argv, "bscan");
init_msg(NULL, NULL);
case STREAM_WIN32_DATA:
case STREAM_FILE_DATA:
case STREAM_SPARSE_DATA:
+ case STREAM_ENCRYPTED_FILE_DATA:
+ case STREAM_ENCRYPTED_WIN32_DATA:
+ case STREAM_ENCRYPTED_MACOS_FORK_DATA:
+ /*
+ * For encrypted stream, this is an approximation.
+ * The data must be decrypted to know the correct length.
+ */
mjcr->JobBytes += rec->data_len;
if (rec->Stream == STREAM_SPARSE_DATA) {
mjcr->JobBytes -= sizeof(uint64_t);
break;
case STREAM_GZIP_DATA:
- mjcr->JobBytes += rec->data_len; /* No correct, we should expand it */
- free_jcr(mjcr); /* done using JCR */
+ case STREAM_ENCRYPTED_FILE_GZIP_DATA:
+ case STREAM_ENCRYPTED_WIN32_GZIP_DATA:
+ /* No correct, we should (decrypt and) expand it
+ done using JCR
+ */
+ mjcr->JobBytes += rec->data_len;
+ free_jcr(mjcr);
break;
case STREAM_SPARSE_GZIP_DATA:
break;
default:
- Pmsg2(0, _("Unknown stream type!!! stream=%d data=%s\n"), rec->Stream, rec->data);
+ Pmsg2(0, _("Unknown stream type!!! stream=%d len=%i\n"), rec->Stream, rec->data_len);
break;
}
return true;
/* We mark Vols as Archive to keep them from being re-written */
bstrncpy(mr->VolStatus, "Archive", sizeof(mr->VolStatus));
mr->VolRetention = 365 * 3600 * 24; /* 1 year */
+ mr->Enabled = 1;
if (vl->VerNum >= 11) {
mr->FirstWritten = btime_to_utime(vl->write_btime);
mr->LabelDate = btime_to_utime(vl->label_btime);
return 0;
}
if (verbose) {
- Pmsg2(000, _("Updated Job termination record for JobId=%u TermStat=%c\n"), jr->JobId,
- jr->JobStatus);
+ Pmsg3(000, _("Updated Job termination record for JobId=%u Level=%s TermStat=%c\n"),
+ jr->JobId, job_level_to_str(mjcr->JobLevel), jr->JobStatus);
}
if (verbose > 1) {
const char *term_msg;
}
/* Dummies to replace askdir.c */
-bool dir_get_volume_info(DCR *dcr, enum get_vol_info_rw writing) { return 1;}
bool dir_find_next_appendable_volume(DCR *dcr) { return 1;}
bool dir_update_volume_info(DCR *dcr, bool relabel) { return 1; }
bool dir_create_jobmedia_record(DCR *dcr) { return 1; }
DEVICE *dev = dcr->dev;
Dmsg0(20, "Enter dir_ask_sysop_to_mount_volume\n");
/* Close device so user can use autochanger if desired */
- dev->close();
fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "),
dcr->VolumeName, dev->print_name());
+ dev->close();
getchar();
return true;
}
+
+bool dir_get_volume_info(DCR *dcr, enum get_vol_info_rw writing)
+{
+ Dmsg0(100, "Fake dir_get_volume_info\n");
+ bstrncpy(dcr->VolCatInfo.VolCatName, dcr->VolumeName, sizeof(dcr->VolCatInfo.VolCatName));
+ dcr->VolCatInfo.VolCatParts = find_num_dvd_parts(dcr);
+ Dmsg2(500, "Vol=%s num_parts=%d\n", dcr->VolCatInfo.VolCatName, dcr->VolCatInfo.VolCatParts);
+ return 1;
+}