/*
- Bacula® - The Network Backup Solution
+ Bacula(R) - The Network Backup Solution
+ Copyright (C) 2000-2015 Kern Sibbald
Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
- The main author of Bacula is Kern Sibbald, with contributions from many
- others, a complete list can be found in the file AUTHORS.
+ The original author of Bacula is Kern Sibbald, with contributions
+ from many others, a complete list can be found in the file AUTHORS.
You may use this file and others of this release according to the
license defined in the LICENSE file, which includes the Affero General
Public License, v3.0 ("AGPLv3") and some additional permissions and
terms pursuant to its AGPLv3 Section 7.
- Bacula® is a registered trademark of Kern Sibbald.
+ This notice must be preserved when any source code is
+ conveyed and/or propagated.
+
+ Bacula(R) is a registered trademark of Kern Sibbald.
*/
/*
*
bool forge_on = false;
pthread_mutex_t device_release_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t wait_device_release = PTHREAD_COND_INITIALIZER;
-
+bool detect_errors = false;
+int errors = 0;
static FF_PKT *ff;
{
fprintf(stderr, _(
PROG_COPYRIGHT
-"\nVersion: %s (%s)\n\n"
+"\n%sVersion: %s (%s)\n\n"
"Usage: bls [options] <device-name>\n"
" -b <file> specify a bootstrap file\n"
" -c <file> specify a Storage configuration file\n"
" -p proceed inspite of errors\n"
" -v be verbose\n"
" -V specify Volume names (separated by |)\n"
-" -? print this message\n\n"), 2000, VERSION, BDATE);
+" -E Check records to detect errors\n"
+" -? print this message\n\n"), 2000, "", VERSION, BDATE);
exit(1);
}
ff = init_find_files();
- while ((ch = getopt(argc, argv, "b:c:d:e:i:jkLpvV:?")) != -1) {
+ while ((ch = getopt(argc, argv, "b:c:d:e:i:jkLpvV:?E")) != -1) {
switch (ch) {
case 'b':
bsrName = optarg;
break;
+ case 'E':
+ detect_errors = true;
+ break;
+
case 'c': /* specify config file */
if (configfile != NULL) {
free(configfile);
}
term_include_exclude_files(ff);
term_find_files(ff);
+
+ if (detect_errors) {
+ return (errors > 0)? 1 : 0;
+ }
return 0;
}
continue;
} else {
/* I/O error */
+ errors++;
display_tape_error_status(jcr, dev);
break;
}
static bool jobs_cb(DCR *dcr, DEV_RECORD *rec)
{
if (rec->FileIndex < 0) {
- dump_label_record(dcr->dev, rec, verbose);
+ dump_label_record(dcr->dev, rec, verbose, detect_errors);
}
rec->remainder = 0;
return true;
/* Do list job records */
static void do_jobs(char *infname)
{
- read_records(dcr, jobs_cb, mount_next_read_volume);
+ if (!read_records(dcr, jobs_cb, mount_next_read_volume)) {
+ errors++;
+ }
}
/* Do an ls type listing of an archive */
dump_volume_label(dev);
return;
}
- read_records(dcr, record_cb, mount_next_read_volume);
+ if (!read_records(dcr, record_cb, mount_next_read_volume)) {
+ errors++;
+ }
printf("%u files found.\n", num_files);
}
static bool record_cb(DCR *dcr, DEV_RECORD *rec)
{
if (verbose && rec->FileIndex < 0) {
- dump_label_record(dcr->dev, rec, verbose);
+ dump_label_record(dcr->dev, rec, verbose, false);
return true;
}
if (verbose) {
bool dir_find_next_appendable_volume(DCR *dcr) { return 1;}
bool dir_update_volume_info(DCR *dcr, bool relabel, bool update_LastWritten) { return 1; }
bool dir_create_jobmedia_record(DCR *dcr, bool zero) { return 1; }
+bool flush_jobmedia_queue(JCR *jcr) { return true; }
bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) { return 1; }
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
bool dir_send_job_status(JCR *jcr) {return 1;}
{
Dmsg0(100, "Fake dir_get_volume_info\n");
dcr->setVolCatName(dcr->VolumeName);
-#ifdef BUILD_DVD
- dcr->VolCatInfo.VolCatParts = find_num_dvd_parts(dcr);
-#endif
- Dmsg2(500, "Vol=%s num_parts=%d\n", dcr->getVolCatName(), dcr->VolCatInfo.VolCatParts);
+ Dmsg2(500, "Vol=%s VolType=%d\n", dcr->getVolCatName(), dcr->VolCatInfo.VolCatType);
return 1;
}