.I bacula-database
.I user
.I password
+.RI [ dbhost ]
+.RI [ dbport ]
.br
.SH DESCRIPTION
This manual page documents briefly the
{
char clientid[50], jobid[50], filesetid[50];
char date[MAX_TIME_LENGTH];
-
- POOL_MEM query (PM_FNAME);
+ POOL_MEM query(PM_FNAME);
bstrutime(date, sizeof(date), time(NULL) + 1);
jobids[0]='\0';
}
if (jr->JobLevel == L_INCREMENTAL || jr->JobLevel == L_VIRTUAL_FULL) {
-
/* Now, find the last differential backup after the last full */
Mmsg(query,
"INSERT INTO btemp3%s (JobId, StartTime, EndTime, JobTDate, PurgedFiles) "
}
-
-static void print_findex(UAContext *ua, RBSR_FINDEX *fi)
-{
- ua->send_msg("fi=0x%lx\n", fi);
- for ( ; fi; fi=fi->next) {
- if (fi->findex == fi->findex2) {
- ua->send_msg("FileIndex=%d\n", fi->findex);
- Dmsg1(1000, "FileIndex=%d\n", fi->findex);
- } else {
- ua->send_msg("FileIndex=%d-%d\n", fi->findex, fi->findex2);
- Dmsg2(1000, "FileIndex=%d-%d\n", fi->findex, fi->findex2);
- }
- }
-}
-
/* Create a new bootstrap record */
RBSR *new_bsr()
{
ua->send_msg(_("Bootstrap records written to %s\n"), fname.c_str());
+ if (debug_level >= 10) {
+ print_bsr(ua, rx);
+ }
+
bail_out:
return count;
}
return total_count;
}
-void print_bsr(UAContext *ua, RBSR *bsr)
+void print_bsr(UAContext *ua, RESTORE_CTX &rx)
{
- for ( ; bsr; bsr=bsr->next) {
- for (int i=0; i < bsr->VolCount; i++) {
- ua->send_msg("Volume=\"%s\"\n", bsr->VolParams[i].VolumeName);
- ua->send_msg("MediaType\"%s\"\n", bsr->VolParams[i].MediaType);
- ua->send_msg("VolSessionId=%u\n", bsr->VolSessionId);
- ua->send_msg("VolSessionTime=%u\n", bsr->VolSessionTime);
- ua->send_msg("VolFile=%u-%u\n", bsr->VolParams[i].StartFile,
- bsr->VolParams[i].EndFile);
- ua->send_msg("VolBlock=%u-%u\n", bsr->VolParams[i].StartBlock,
- bsr->VolParams[i].EndBlock);
- print_findex(ua, bsr->fi);
- }
- print_bsr(ua, bsr->next);
- }
+ write_bsr(ua, rx, stdout);
}
void add_findex_all(RBSR *bsr, uint32_t JobId);
RBSR_FINDEX *new_findex();
void make_unique_restore_filename(UAContext *ua, POOLMEM **fname);
-void print_bsr(UAContext *ua, RBSR *bsr);
+void print_bsr(UAContext *ua, RESTORE_CTX &rx);
/* catreq.c */
}
POOLMEM *jobids = get_pool_memory(PM_FNAME);
+ jcr->jr.JobLevel = L_VIRTUAL_FULL;
db_accurate_get_jobids(jcr, jcr->db, &jcr->jr, jobids);
- Dmsg1(100, "Accurate jobids=%s\n", jobids);
+ jcr->jr.JobLevel = L_FULL;
+ Dmsg1(10, "Accurate jobids=%s\n", jobids);
if (*jobids == 0) {
free_pool_memory(jobids);
Jmsg(jcr, M_FATAL, 0, _("Cannot find previous JobIds.\n"));
char sdt[50], edt[50], schedt[50];
char ec1[30], ec3[30], ec4[30], compress[50];
char ec7[30], ec8[30], elapsed[50];
- char term_code[100], fd_term_msg[100], sd_term_msg[100];
+ char term_code[100], sd_term_msg[100];
const char *term_msg;
int msg_type = M_INFO;
MEDIA_DBR mr;
bsnprintf(compress, sizeof(compress), "%.1f %%", compression);
}
}
- jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg));
jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg));
-// bmicrosleep(15, 0); /* for debugging SIGHUP */
-
Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n"
" Build OS: %s %s %s\n"
" JobId: %d\n"
" Job: %s\n"
-" Backup Level: %s%s\n"
+" Backup Level: Virtual Full\n"
" Client: \"%s\" %s\n"
" FileSet: \"%s\" %s\n"
" Pool: \"%s\" (From %s)\n"
" SD Files Written: %s\n"
" SD Bytes Written: %s (%sB)\n"
" Rate: %.1f KB/s\n"
-" Software Compression: %s\n"
-" VSS: %s\n"
" Encryption: %s\n"
" Accurate: %s\n"
" Volume name(s): %s\n"
HOST_OS, DISTNAME, DISTVER,
jcr->jr.JobId,
jcr->jr.Job,
- level_to_str(jcr->get_JobLevel()), jcr->since,
jcr->client->name(), cr.Uname,
jcr->fileset->name(), jcr->FSCreateTime,
jcr->pool->name(), jcr->pool_source,
edit_uint64_with_commas(jcr->jr.JobBytes, ec3),
edit_uint64_with_suffix(jcr->jr.JobBytes, ec4),
kbps,
- compress,
- jcr->VSS?_("yes"):_("no"),
jcr->Encrypt?_("yes"):_("no"),
jcr->accurate?_("yes"):_("no"),
jcr->VolumeName,
#endif
complete_bsr(ua, rx.bsr);
-// Dmsg0(000, "Print bsr\n");
-// print_bsr(ua, rx.bsr);
-
jcr->ExpectedFiles = write_bsr_file(ua, rx);
- Dmsg1(000, "Found %d files to consolidate.\n", jcr->ExpectedFiles);
+ if (debug_level >= 10) {
+ Dmsg1(000, "Found %d files to consolidate.\n", jcr->ExpectedFiles);
+ }
if (jcr->ExpectedFiles == 0) {
free_ua_context(ua);
free_bsr(rx.bsr);
if (dev->can_read()) {
VOLUME_CAT_INFO *vol = &dev->VolCatInfo;
dev->clear_read(); /* clear read bit */
- Dmsg2(000, "dir_update_vol_info. label=%d Vol=%s\n",
+ Dmsg2(150, "dir_update_vol_info. label=%d Vol=%s\n",
dev->is_labeled(), vol->VolCatName);
if (dev->is_labeled() && vol->VolCatName[0] != 0) {
dir_update_volume_info(dcr, false, false); /* send Volume info to Director */
static void usage()
{
fprintf(stderr,
-"Usage: dbcheck [-c config] [-C catalog name] [-d debug_level] <working-directory> <bacula-database> <user> <password> [<dbhost>]\n"
+"Usage: dbcheck [-c config] [-C catalog name] [-d debug_level] <working-directory> <bacula-database> <user> <password> [<dbhost>] [<dbport>]\n"
" -b batch mode\n"
" -C catalog name in the director conf file\n"
" -c Director conf filename\n"
{
int ch;
const char *user, *password, *db_name, *dbhost;
+ int dbport = 0;
char *configfile = NULL;
char *catalogname = NULL;
+ char *endptr;
setlocale(LC_ALL, "");
bindtextdomain("bacula", LOCALEDIR);
if (dbhost && dbhost[0] == 0) {
dbhost = NULL;
}
+ dbport = catalog->db_port;
}
} else {
- if (argc > 5) {
+ if (argc > 6) {
Pmsg0(0, _("Wrong number of arguments.\n"));
usage();
}
user = argv[2];
password = argv[3];
dbhost = argv[4];
+ } else if (argc == 6) {
+ db_name = argv[1];
+ user = argv[2];
+ password = argv[3];
+ dbhost = argv[4];
+ dbport = strtol(argv[5], &endptr, 10);
+ if (*endptr != '\0') {
+ Pmsg0(0, _("Database port must be a numeric value.\n"));
+ exit(1);
+ } else if (dbport == LONG_MIN || dbport == LONG_MAX) {
+ Pmsg0(0, _("Database port must be a int value.\n"));
+ exit(1);
+ }
}
}
/* Open database */
- db = db_init_database(NULL, db_name, user, password, dbhost, 0, NULL, 0);
+ db = db_init_database(NULL, db_name, user, password, dbhost, dbport, NULL, 0);
if (!db_open_database(NULL, db)) {
Emsg1(M_FATAL, 0, "%s", db_strerror(db));
return 1;
#undef VERSION
#define VERSION "2.5.3"
-#define BDATE "26 Aug 2008"
-#define LSMDATE "26Aug08"
+#define BDATE "28 Aug 2008"
+#define LSMDATE "28Aug08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
General:
28Aug08
+kes Correct a problem with Level and Virtual backup, rework how
+ bsrs are printed in debug to use standard routine.
+kes Apply patch from Chris in bug #1133 that provides alternate db port
+ support for dbcheck.
ebl Remove catalog dependency from bcopy tool.
ebl Modify catalog scripts to have an easier packaging integration,
using default variables.