static char *db_name = "bacula";
static char *db_user = "bacula";
static char *db_password = "";
+static char *db_host = NULL;
static char *wd = NULL;
static int update_db = 0;
static int update_vol_info = 0;
"Usage: bscan [-d debug_level] <bacula-archive>\n"
" -b bootstrap specify a bootstrap file\n"
" -c <file> specify configuration file\n"
-" -dnn set debug level to nn\n"
+" -d <nn> set debug level to nn\n"
" -m update media info in database\n"
-" -n name specify the database name (default bacula)\n"
-" -u user specify database user name (default bacula)\n"
-" -p password specify database password (default none)\n"
+" -n <name> specify the database name (default bacula)\n"
+" -u <user> specify database user name (default bacula)\n"
+" -p <password specify database password (default none)\n"
+" -h <host> specify database host (default NULL)\n"
" -r list records\n"
" -s synchronize or store in database\n"
" -v verbose\n"
-" -V specify Volume names (separated by |)\n"
-" -w dir specify working directory (default from conf file)\n"
+" -V <Volumes> specify Volume names (separated by |)\n"
+" -w <dir> specify working directory (default from conf file)\n"
" -? print this message\n\n"));
exit(1);
}
init_msg(NULL, NULL);
- while ((ch = getopt(argc, argv, "b:c:d:mn:p:rsu:vV:w:?")) != -1) {
+ while ((ch = getopt(argc, argv, "b:c:d:h:mn:p:rsu:vV:w:?")) != -1) {
switch (ch) {
case 'b':
bsr = parse_bsr(NULL, optarg);
debug_level = 1;
break;
+ case 'h':
+ db_host = optarg;
+ break;
+
case 'm':
update_vol_info = 1;
break;
exit(1);
}
- if ((db=db_init_database(NULL, db_name, db_user, db_password, NULL, 0, NULL)) == NULL) {
+ if ((db=db_init_database(NULL, db_name, db_user, db_password, db_host, 0, NULL)) == NULL) {
Emsg0(M_ERROR_TERM, 0, _("Could not init Bacula database\n"));
}
if (!db_open_database(NULL, db)) {