/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2012 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.
memset(&jr, 0, sizeof(jr));
memset(&pr, 0, sizeof(pr));
- memset(&mr, 0, sizeof(mr));
Dmsg1(20, "list: %s\n", cmd);
ua->error_msg(_("Hey! DB is NULL\n"));
}
+ /* Apply any limit */
+ j = find_arg_with_value(ua, NT_("limit"));
+ if (j >= 0) {
+ jr.limit = atoi(ua->argv[j]);
+ }
+
/* Scan arguments looking for things to do */
for (i=1; i<ua->argc; i++) {
/* List JOBS */
if (strcasecmp(ua->argk[i], NT_("jobs")) == 0) {
- /* Apply any limit */
- j = find_arg_with_value(ua, NT_("limit"));
- if (j >= 0) {
- jr.limit = atoi(ua->argv[j]);
- }
db_list_job_records(ua->jcr, ua->db, &jr, prtit, ua, llist);
/* List JOBTOTALS */
MEDIA_DBR mr;
POOL_DBR pr;
- memset(&mr, 0, sizeof(mr));
int i = find_arg_with_value(ua, "job");
if (i <= 0) {
if ((job = select_job_resource(ua)) == NULL) {
}
mr.PoolId = jcr->jr.PoolId;
get_job_storage(&store, job, run);
- mr.StorageId = store.store->StorageId;
+ set_storageid_in_mr(store.store, &mr);
/* no need to set ScratchPoolId, since we use fnv_no_create_vol */
if (!find_next_volume_for_append(jcr, &mr, 1, fnv_no_create_vol, fnv_prune)) {
ua->error_msg(_("Could not find next Volume for Job %s (Pool=%s, Level=%s).\n"),
}
get_out:
- db_close_database(jcr, jcr->db);
- jcr->db = NULL;
+ if (jcr->db) {
+ db_close_database(jcr, jcr->db);
+ jcr->db = NULL;
+ }
free_jcr(jcr);
if (!found) {
ua->error_msg(_("Could not find next Volume for Job %s.\n"),
}
Dmsg0(100, "complete_jcr open db\n");
- jcr->db = db_init(jcr, jcr->catalog->db_driver, jcr->catalog->db_name,
- jcr->catalog->db_user,
- jcr->catalog->db_password, jcr->catalog->db_address,
- jcr->catalog->db_port, jcr->catalog->db_socket,
- jcr->catalog->mult_db_connections);
+ jcr->db = db_init_database(jcr, jcr->catalog->db_driver, jcr->catalog->db_name,
+ jcr->catalog->db_user,
+ jcr->catalog->db_password, jcr->catalog->db_address,
+ jcr->catalog->db_port, jcr->catalog->db_socket,
+ jcr->catalog->mult_db_connections,
+ jcr->catalog->disable_batch_insert);
if (!jcr->db || !db_open_database(jcr, jcr->db)) {
Jmsg(jcr, M_FATAL, 0, _("Could not open database \"%s\".\n"),
jcr->catalog->db_name);