From af0dbe774509b4aec298960eb45dd817de5849c1 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 5 Jan 2006 16:23:46 +0000 Subject: [PATCH] - Start implementing Verify list output. - Move the suitable_drive flag to a better place to prevent premature termination of the reservation if all drives are busy -- should fix Arno's diff/inc pool failures. 26Dec05 - Add mutex to single thread VSS code in Win32. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2716 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 9 ++++++++- bacula/ReleaseNotes | 10 ++++++++++ bacula/kernstodo | 12 +++++++++++- bacula/kes-1.38 | 9 ++++++++- bacula/kes-1.39 | 7 +++++++ bacula/src/dird/dird_conf.c | 4 ++++ bacula/src/dird/dird_conf.h | 5 ++++- bacula/src/dird/ua_run.c | 17 ++++++++++++++++- bacula/src/stored/reserve.c | 9 +++++---- 9 files changed, 73 insertions(+), 9 deletions(-) diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 7cef386b6b..3f060ac0d7 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,5 +1,12 @@ -Changes to 1.38.3: +Release 1.38.3 05Jan06: +04Jan06 +- Move the suitable_drive flag to a better place to prevent + premature termination of the reservation if all drives + are busy -- should fix Arno's diff/inc pool failures. +26Dec05 +- Add mutex to single thread VSS code in Win32. + Beta release 23Dec05: 22Dec05 - Add OPENSSL_INC to console dependencies, lib dependencies, and diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index ab934c45c4..e4346a291a 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -299,6 +299,11 @@ New configure options: required only if you do not want the default /usr/share. Items to note!!! +- The Storage daemon now keeps track of what tapes it is using + (was not the case in 1.36.x). This means that you must be much + more careful when removing tapes and putting up a new one. In + general, you should always do a "unmount" prior to removing a + tape, and a "mount" after putting a new one into the drive. - If you use an Autochanger, you MUST update your SD conf file to use the new Autochanger resource. Otherwise, certain commands such as "update slots" may not work. @@ -349,3 +354,8 @@ Other Items: files, called "parts". - For the details of the Python scripting support, please see the new Python Scripting chapter in the manual. +- The default user/group for the Director and Storage daemon installed + by rpms is bacula/bacula, thus you may need to add additional permissions + to your database, or modify the permissions of the tape drive. If + all else fails, change to using user=root. However, it is more secure + to use user=bacula. diff --git a/bacula/kernstodo b/bacula/kernstodo index c57a9a624c..b2a4fb393b 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,5 +1,5 @@ Kern's ToDo List - 07 December 2005 + 26 December 2005 Major development: Project Developer @@ -14,6 +14,16 @@ Document: - Does WildFile match against full name? Doc. - %d and %v only valid on Director, not for ClientRunBefore/After. +Priority: +- Implement status that shows why a job is being held in reserve, or + rather why none of the drives are suitable. +- Implement a way to disable a drive (so you can use the second + drive of an autochanger, and the first one will not be used or + even defined). +- Implement code that makes the Dir aware that a drive is an + autochanger (so the user doesn't need to use the Autochanger = yes + directive). + For 1.39: - Make hardlink code at line 240 of find_one.c use binary search. - Queue warning/error messages during restore so that they diff --git a/bacula/kes-1.38 b/bacula/kes-1.38 index cac5757dc3..d5b5a4e7a7 100644 --- a/bacula/kes-1.38 +++ b/bacula/kes-1.38 @@ -3,7 +3,14 @@ General: -Changes to 1.38.3: +Release 1.38.3 05Jan06: +04Jan06 +- Move the suitable_drive flag to a better place to prevent + premature termination of the reservation if all drives + are busy -- should fix Arno's diff/inc pool failures. +26Dec05 +- Add mutex to single thread VSS code in Win32. + Beta release 23Dec05: 22Dec05 - Add OPENSSL_INC to console dependencies, lib dependencies, and diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 index ab6b2c0e4a..ca82eca3b1 100644 --- a/bacula/kes-1.39 +++ b/bacula/kes-1.39 @@ -4,6 +4,13 @@ General: Changes to 1.39.3: +04Jan06 +- Start implementing Verify list output. +- Move the suitable_drive flag to a better place to prevent + premature termination of the reservation if all drives + are busy -- should fix Arno's diff/inc pool failures. +26Dec05 +- Add mutex to single thread VSS code in Win32. 22Dec05 - Simplify code in askdir.c that waits for creating an appendable volume so that it can handle multiple returns from the wait diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 6fd684c206..bf15f6d3f5 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -239,9 +239,13 @@ RES_ITEM job_items[] = { {"migrationjob", store_res, ITEM(res_job.migration_job), R_JOB, 0, 0}, {"jobdefs", store_res, ITEM(res_job.jobdefs), R_JOBDEFS, 0, 0}, {"run", store_alist_str, ITEM(res_job.run_cmds), 0, 0, 0}, + /* Root of where to restore files */ {"where", store_dir, ITEM(res_job.RestoreWhere), 0, 0, 0}, + /* Where to find bootstrap during restore */ {"bootstrap",store_dir, ITEM(res_job.RestoreBootstrap), 0, 0, 0}, + /* Where to write bootstrap file during backup */ {"writebootstrap",store_dir, ITEM(res_job.WriteBootstrap), 0, 0, 0}, + {"writeverifylist",store_dir, ITEM(res_job.WriteVerifyList), 0, 0, 0}, {"replace", store_replace, ITEM(res_job.replace), 0, ITEM_DEFAULT, REPLACE_ALWAYS}, {"maxruntime", store_time, ITEM(res_job.MaxRunTime), 0, 0, 0}, {"fullmaxwaittime", store_time, ITEM(res_job.FullMaxWaitTime), 0, 0, 0}, diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index 8e980d621f..3fb7128856 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -284,7 +284,10 @@ public: char *RunAfterFailedJob; /* Run program after Job that errs */ char *ClientRunBeforeJob; /* Run client program before Job */ char *ClientRunAfterJob; /* Run client program after Job */ - char *WriteBootstrap; /* Where to write bootstrap Job updates */ + union { + char *WriteBootstrap; /* Where to write bootstrap Job updates */ + char *WriteVerifyList; /* List of changed files */ + }; int replace; /* How (overwrite, ..) */ utime_t MaxRunTime; /* max run time in seconds */ utime_t MaxWaitTime; /* max blocking time in seconds */ diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 189bb48c34..e544817cf0 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -48,6 +48,7 @@ int run_cmd(UAContext *ua, const char *cmd) const char *replace; char *when, *verify_job_name, *catalog_name; char *since = NULL; + char *verify_list; bool cloned = false; int Priority = 0; int i, j, opt, files = 0; @@ -79,6 +80,7 @@ int run_cmd(UAContext *ua, const char *cmd) "catalog", /* 17 override catalog */ "since", /* 18 since */ "cloned", /* 19 cloned */ + "verifylist", /* 20 verify output list */ NULL}; #define YES_POS 14 @@ -100,6 +102,7 @@ int run_cmd(UAContext *ua, const char *cmd) replace = NULL; verify_job_name = NULL; catalog_name = NULL; + verify_list = NULL; for (i=1; iargc; i++) { Dmsg2(800, "Doing arg %d = %s\n", i, ua->argk[i]); @@ -247,6 +250,11 @@ int run_cmd(UAContext *ua, const char *cmd) kw_ok = true; break; + case 20: /* write verify list output */ + verify_list = ua->argv[i]; + kw_ok = true; + break; + default: break; } @@ -541,6 +549,12 @@ try_again: } else { Name = ""; } + if (!verify_list) { + verify_list = job->WriteVerifyList; + } + if (!verify_list) { + verify_list = ""; + } bsendmsg(ua, _("Run %s job\n" "JobName: %s\n" "FileSet: %s\n" @@ -549,6 +563,7 @@ try_again: "Storage: %s\n" "Pool: %s\n" "Verify Job: %s\n" +"Verify List: %s\n" "When: %s\n" "Priority: %d\n"), _("Verify"), @@ -559,6 +574,7 @@ try_again: jcr->store->hdr.name, NPRT(jcr->pool->hdr.name), Name, + verify_list, bstrutime(dt, sizeof(dt), jcr->sched_time), jcr->JobPriority); } @@ -627,7 +643,6 @@ try_again: goto bail_out; } - if (!get_cmd(ua, _("OK to run? (yes/mod/no): "))) { goto bail_out; } diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index eb10b41a11..be97a764e5 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -9,7 +9,7 @@ * */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -507,15 +507,15 @@ bool find_suitable_device_for_job(JCR *jcr, RCTX &rctx) rctx.device_name = device_name; stat = search_res_for_device(rctx); if (stat == 1) { /* found available device */ - rctx.suitable_device = true; Dmsg1(100, "Suitable device found=%s\n", device_name); ok = true; break; } else if (stat == 0) { /* device busy */ Dmsg1(100, "Suitable busy device found=%s\n", device_name); - rctx.suitable_device = true; /* but it is busy, so continue looking */ + } else { + /* otherwise error */ + Dmsg0(100, "No suitable device found.\n"); } - /* otherwise error */ } if (ok) { break; @@ -623,6 +623,7 @@ static int reserve_device(RCTX &rctx) return -1; /* no use waiting */ } + rctx.suitable_device = true; Dmsg2(100, "Try reserve %s jobid=%d\n", rctx.device->hdr.name, rctx.jcr->JobId); dcr = new_dcr(rctx.jcr, rctx.device->dev); -- 2.39.5