From 008693fe890468a269f42f8bafe79c461203ebf0 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 31 Jul 2004 13:00:30 +0000 Subject: [PATCH] Update all pools when starting the Director git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1502 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 37 ++++++++++++- bacula/src/dird/dird.c | 101 +++++++++++++++++----------------- bacula/src/version.h | 4 +- bacula/src/win32/README.win32 | 6 +- 4 files changed, 94 insertions(+), 54 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 3f47599c7e..d658371768 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -2,6 +2,7 @@ 22 July 2004 1.35 Items to do: +- Knoppix CDROM - Add bscan to four-concurrent-jobs regression. - Do tape alerts -- see tapealert.txt - Document a get out of jail procedure if everything breaks if @@ -62,12 +63,47 @@ For 1.37 Testing/Documentation: non-existent directories will not be restored properly. Wish list: +- Implement the FreeBSD nodump flag in chflags. - Figure out how to make named console messages go only to that console and to the non-restricted console (new console class?). - Make restricted console prompt for password if *ask* is set or perhaps if password is undefined. - Implement "from ISO-date/time every x hours/days/weeks/months" in schedules. +==== from Marc Schoechlin +- the help-command should be more verbose + (it should explain the paramters of the different + commands in detail) + -> it´s time-comsuming to consult the manual anytime + you need a special parameter + -> maybe it´s more easy to maintain this, if the + descriptions of that commands are outsourced to + a ceratin-file +- the cd-command should allow complete paths + i.e. cd /foo/bar/foo/bar + -> if a customer mails me the path to a certain file, + it´s faster to enter the specified directory +- if the password is not configured in bconsole.conf + you should be asked for it. + -> sometimes you like to do restore on a customer-machine + which shouldn´t know the password for bacula. + -> adding the password to the file favours admins + to forget to remove the password after usage + -> security-aspects + the protection of that file is less important +- long-listed-output of commands should be scrollable + like the unix more/less-command does + -> if someone runs 200 and more machines, the lists could + be a little long and complex +- command-output should be shown column by column + to reduce scrolling and to increase clarity + -> see last item +- lsmark should list the selected files with full + paths +- wildcards for selecting and file and directories would be nice +- any actions should be interuptable with STRG+C +- command-expansion would be pretty cool +==== - Compaction of Disk space by "migrating" Volumes that have pruned Jobs (what criteria? size, #jobs, time). - Add prune all command @@ -1116,4 +1152,3 @@ Block Position: 0 - Add better error codes to run_program (10000+) - Revisit and revise Disaster Recovery (fix SCSI and RAID disk detection) - diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index 3865ed0587..e465a06d4b 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -579,59 +579,62 @@ Without that I don't know who I am :-(\n"), configfile); Emsg0(M_ERROR_TERM, 0, "Too many items in Job resource\n"); } } - if (job->client && job->client->catalog) { - CAT *catalog = job->client->catalog; - B_DB *db; - - /* - * Make sure we can open catalog, otherwise print a warning - * message because the server is probably not running. - */ - db = db_init_database(NULL, catalog->db_name, catalog->db_user, - catalog->db_password, catalog->db_address, - catalog->db_port, catalog->db_socket); - if (!db || !db_open_database(NULL, db)) { - Jmsg(NULL, M_FATAL, 0, _("Could not open database \"%s\".\n"), - catalog->db_name); - if (db) { - Jmsg(NULL, M_FATAL, 0, _("%s"), db_strerror(db)); - } - OK = false; - } else { - /* If a pool is defined for this job, create the pool DB - * record if it is not already created. - */ - if (job->pool) { - create_pool(NULL, db, job->pool, POOL_OP_UPDATE); /* update request */ + } /* End loop over Job res */ + + /* Loop over databases */ + CAT *catalog; + foreach_res(catalog, R_CATALOG) { + B_DB *db; + /* + * Make sure we can open catalog, otherwise print a warning + * message because the server is probably not running. + */ + db = db_init_database(NULL, catalog->db_name, catalog->db_user, + catalog->db_password, catalog->db_address, + catalog->db_port, catalog->db_socket); + if (!db || !db_open_database(NULL, db)) { + Jmsg(NULL, M_FATAL, 0, _("Could not open database \"%s\".\n"), + catalog->db_name); + if (db) { + Jmsg(NULL, M_FATAL, 0, _("%s"), db_strerror(db)); + } + OK = false; + continue; + } + + /* Loop over all pools, defining/updating them in each database */ + POOL *pool; + foreach_res(pool, R_POOL) { + create_pool(NULL, db, pool, POOL_OP_UPDATE); /* update request */ + } + /* Loop over all counters, defining them in each database */ + + /* Set default value in all counters */ + COUNTER *counter; + foreach_res(counter, R_COUNTER) { + /* Write to catalog? */ + if (!counter->created && counter->Catalog == catalog) { + COUNTER_DBR cr; + bstrncpy(cr.Counter, counter->hdr.name, sizeof(cr.Counter)); + cr.MinValue = counter->MinValue; + cr.MaxValue = counter->MaxValue; + cr.CurrentValue = counter->MinValue; + if (counter->WrapCounter) { + bstrncpy(cr.WrapCounter, counter->WrapCounter->hdr.name, sizeof(cr.WrapCounter)); + } else { + cr.WrapCounter[0] = 0; /* empty string */ } - /* Set default value in all counters */ - COUNTER *counter; - foreach_res(counter, R_COUNTER) { - /* Write to catalog? */ - if (!counter->created && counter->Catalog == catalog) { - COUNTER_DBR cr; - bstrncpy(cr.Counter, counter->hdr.name, sizeof(cr.Counter)); - cr.MinValue = counter->MinValue; - cr.MaxValue = counter->MaxValue; - cr.CurrentValue = counter->MinValue; - if (counter->WrapCounter) { - bstrncpy(cr.WrapCounter, counter->WrapCounter->hdr.name, sizeof(cr.WrapCounter)); - } else { - cr.WrapCounter[0] = 0; /* empty string */ - } - if (db_create_counter_record(NULL, db, &cr)) { - counter->CurrentValue = cr.CurrentValue; - counter->created = true; - Dmsg2(100, "Create counter %s val=%d\n", counter->hdr.name, counter->CurrentValue); - } - } - if (!counter->created) { - counter->CurrentValue = counter->MinValue; /* default value */ - } + if (db_create_counter_record(NULL, db, &cr)) { + counter->CurrentValue = cr.CurrentValue; + counter->created = true; + Dmsg2(100, "Create counter %s val=%d\n", counter->hdr.name, counter->CurrentValue); } + } + if (!counter->created) { + counter->CurrentValue = counter->MinValue; /* default value */ } - db_close_database(NULL, db); } + db_close_database(NULL, db); } UnlockRes(); diff --git a/bacula/src/version.h b/bacula/src/version.h index 72b21a2367..67c7cfb2b5 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #undef VERSION #define VERSION "1.35.1" -#define BDATE "28 July 2004" -#define LSMDATE "28Jul04" +#define BDATE "30 July 2004" +#define LSMDATE "30Jul04" /* Debug flags */ #undef DEBUG diff --git a/bacula/src/win32/README.win32 b/bacula/src/win32/README.win32 index e4bee1eab6..10f655072f 100644 --- a/bacula/src/win32/README.win32 +++ b/bacula/src/win32/README.win32 @@ -40,6 +40,7 @@ To build it: - You need the Platform SDK installed. - You need Visual Studio installed. - You need to load depkgs-win32, then + (make the two patches described below to in Nicolas' notes to wx) cd depkgs-win32 make (after building zlib and pthreads, it fails in wx) @@ -108,8 +109,9 @@ Instructions if you want to build wx-console : - Additional information on using the free Micrsosoft C++ see http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit -NOTE! I (Kern) cannot build wxWindows with the Makefile -- I had to use -VC Studio directly to do so following their instructions. +NOTE! I (Kern) cannot build wxWindows with the Makefile until after +I do a ./configure. I can us VC Studio directly to do so +following their instructions. Getting all the environment variables setup properly is not always so obvious. Here is what I have when I do a "set" in a rxvt window, in which I build -- 2.39.2