]> git.sur5r.net Git - bacula/bacula/commitdiff
- Add complete text of GPL to LICENSE.
authorKern Sibbald <kern@sibbald.com>
Mon, 26 Jun 2006 16:00:29 +0000 (16:00 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 26 Jun 2006 16:00:29 +0000 (16:00 +0000)
- Implement job report that indicates where Storage and Pool
  came from -- with overrides and Pool storage and NextPool,
  it is all very complicated.
- Create a few common subroutines for backup.c and migrate.c
- Eliminate warning messages from tray-monitor.c

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3077 91ce42f0-d328-0410-95d8-f526ca767f89

13 files changed:
bacula/LICENSE
bacula/kes-1.39
bacula/src/dird/backup.c
bacula/src/dird/dird_conf.c
bacula/src/dird/dird_conf.h
bacula/src/dird/job.c
bacula/src/dird/jobq.c
bacula/src/dird/migrate.c
bacula/src/dird/protos.h
bacula/src/dird/run_conf.c
bacula/src/dird/scheduler.c
bacula/src/jcr.h
bacula/src/version.h

index 7b65ee5474086b1dd71397fabbdfcc5479917619..ee5e5656b812d149b608bd193d91657528b682ba 100644 (file)
@@ -72,7 +72,7 @@ copyrighted code.
 
 =====================================
 
-The entire GPL is reproduced in the manuals distributed with the
+The entire GPL is reproduced below, in the manuals distributed with the
 Bacula documentation and can also be found online on the GNU web site
 as well as at www.bacula.org. You may also obtain a copy of the
 GPL (or LGPL) by writing to: Free Software Foundation, Inc., 
@@ -99,3 +99,348 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+============== Text of GPL version 2 license ========
+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+\f
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
+
+===========================================
index b7159eb6039addfe3b196ff8aac7ad35f998161e..f575d93bccbb09fb04e28076b6b1eac2a1b580f3 100644 (file)
@@ -2,6 +2,13 @@
                         Kern Sibbald
 
 General:
+26Jun06
+- Add complete text of GPL to LICENSE.
+- Implement job report that indicates where Storage and Pool
+  came from -- with overrides and Pool storage and NextPool,
+  it is all very complicated.
+- Create a few common subroutines for backup.c and migrate.c
+- Eliminate warning messages from tray-monitor.c
 25Jun06
 - Apply fix for scheduler for missing unlock_jobs().
 - Clean out autoconf caches before rebuilding configure
index 83e51fc1b94d9c4869eced56b47723036b5f9b30..fe7cbc292c15b8364b1c8d55c5e9eb80b4bf452d 100644 (file)
@@ -48,7 +48,6 @@ static char EndJob[]     = "2800 End Job TermCode=%d JobFiles=%u "
  */
 bool do_backup_init(JCR *jcr)
 {
-   POOL_DBR pr;
 
    if (!get_or_create_fileset_record(jcr)) {
       return false;
@@ -59,48 +58,15 @@ bool do_backup_init(JCR *jcr)
     */
    get_level_since_time(jcr, jcr->since, sizeof(jcr->since));
 
-   /*
-    * Apply any level related Pool selections
-    */
-   switch (jcr->JobLevel) {
-   case L_FULL:
-      if (jcr->full_pool) {
-         jcr->pool = jcr->full_pool;
-      }
-      break;
-   case L_INCREMENTAL:
-      if (jcr->inc_pool) {
-         jcr->pool = jcr->inc_pool;
-      }
-      break;
-   case L_DIFFERENTIAL:
-      if (jcr->dif_pool) {
-         jcr->pool = jcr->dif_pool;
-      }
-      break;
-   }
-   memset(&pr, 0, sizeof(pr));
-   bstrncpy(pr.Name, jcr->pool->hdr.name, sizeof(pr.Name));
+   apply_pool_overrides(jcr);
 
-   if (!db_get_pool_record(jcr, jcr->db, &pr)) { /* get by Name */
-      /* Try to create the pool */
-      if (create_pool(jcr, jcr->db, jcr->pool, POOL_OP_CREATE) < 0) {
-         Jmsg(jcr, M_FATAL, 0, _("Pool %s not in database. %s"), pr.Name,
-            db_strerror(jcr->db));
-         return false;
-      } else {
-         Jmsg(jcr, M_INFO, 0, _("Pool %s created in database.\n"), pr.Name);
-         if (!db_get_pool_record(jcr, jcr->db, &pr)) { /* get by Name */
-            Jmsg(jcr, M_FATAL, 0, _("Pool %s not in database. %s"), pr.Name,
-               db_strerror(jcr->db));
-            return false;
-         }
-      }
+   jcr->jr.PoolId = get_or_create_pool_record(jcr, jcr->pool->hdr.name);
+   if (jcr->jr.PoolId == 0) {
+      return false;
    }
-   jcr->jr.PoolId = pr.PoolId;
 
    /* If pool storage specified, use it instead of job storage */
-   copy_storage(jcr, jcr->pool->storage);
+   copy_storage(jcr, jcr->pool->storage, _("Pool resource"));
 
    if (!jcr->storage) {
       Jmsg(jcr, M_FATAL, 0, _("No Storage specification found in Job or Pool.\n"));
@@ -454,8 +420,8 @@ void backup_cleanup(JCR *jcr, int TermCode)
 "  Backup Level:           %s%s\n"
 "  Client:                 \"%s\" %s\n"
 "  FileSet:                \"%s\" %s\n"
-"  Pool:                   \"%s\"\n"
-"  Storage:                \"%s\"\n"
+"  Pool:                   \"%s\" (From %s)\n"
+"  Storage:                \"%s\" (From %s)\n"
 "  Scheduled time:         %s\n"
 "  Start time:             %s\n"
 "  End time:               %s\n"
@@ -484,8 +450,8 @@ void backup_cleanup(JCR *jcr, int TermCode)
         level_to_str(jcr->JobLevel), jcr->since,
         jcr->client->hdr.name, cr.Uname,
         jcr->fileset->hdr.name, jcr->FSCreateTime,
-        jcr->pool->hdr.name,
-        jcr->store->hdr.name,
+        jcr->pool->hdr.name, jcr->pool_source,
+        jcr->store->hdr.name, jcr->storage_source,
         schedt,
         sdt,
         edt,
index 8bd16ae9eb5978636c5c7e1495fc356498264f49..9eedba0e6f9113abf8437228dfb1b221d5ab2bd8 100644 (file)
@@ -236,7 +236,7 @@ RES_ITEM job_items[] = {
    {"pool",      store_res,     ITEM(res_job.pool),     R_POOL, ITEM_REQUIRED, 0},
    {"fullbackuppool",  store_res, ITEM(res_job.full_pool),   R_POOL, 0, 0},
    {"incrementalbackuppool",  store_res, ITEM(res_job.inc_pool), R_POOL, 0, 0},
-   {"differentialbackuppool", store_res, ITEM(res_job.dif_pool), R_POOL, 0, 0},
+   {"differentialbackuppool", store_res, ITEM(res_job.diff_pool), R_POOL, 0, 0},
    {"client",    store_res,     ITEM(res_job.client),   R_CLIENT, ITEM_REQUIRED, 0},
    {"fileset",   store_res,     ITEM(res_job.fileset),  R_FILESET, ITEM_REQUIRED, 0},
    {"schedule",  store_res,     ITEM(res_job.schedule), R_SCHEDULE, 0, 0},
@@ -626,9 +626,9 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
          sendit(sock, _("  --> "));
          dump_resource(-R_POOL, (RES *)res->res_job.inc_pool, sendit, sock);
       }
-      if (res->res_job.dif_pool) {
+      if (res->res_job.diff_pool) {
          sendit(sock, _("  --> "));
-         dump_resource(-R_POOL, (RES *)res->res_job.dif_pool, sendit, sock);
+         dump_resource(-R_POOL, (RES *)res->res_job.diff_pool, sendit, sock);
       }
       if (res->res_job.verify_job) {
          sendit(sock, _("  --> "));
@@ -1246,7 +1246,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
          res->res_job.pool       = res_all.res_job.pool;
          res->res_job.full_pool  = res_all.res_job.full_pool;
          res->res_job.inc_pool   = res_all.res_job.inc_pool;
-         res->res_job.dif_pool   = res_all.res_job.dif_pool;
+         res->res_job.diff_pool  = res_all.res_job.diff_pool;
          res->res_job.verify_job = res_all.res_job.verify_job;
          res->res_job.jobdefs    = res_all.res_job.jobdefs;
          res->res_job.run_cmds   = res_all.res_job.run_cmds;
index 23ff69d42d5571aa829a4682725121813c1fe984..f6a80fea9739d8a0fc68147d94d19b381ac949a8 100644 (file)
@@ -317,7 +317,7 @@ public:
    POOL      *pool;                   /* Where is media -- Media Pool */
    POOL      *full_pool;              /* Pool for Full backups */
    POOL      *inc_pool;               /* Pool for Incremental backups */
-   POOL      *dif_pool;               /* Pool for Differental backups */
+   POOL      *diff_pool;              /* Pool for Differental backups */
    POOL      *next_pool;              /* Next Pool for Migration */
    char      *selection_pattern;
    int        selection_type;
@@ -476,7 +476,7 @@ public:
    POOL *pool;                        /* Pool override */
    POOL *full_pool;                   /* Pool override */
    POOL *inc_pool;                    /* Pool override */
-   POOL *dif_pool;                    /* Pool override */
+   POOL *diff_pool;                   /* Pool override */
    STORE *storage;                    /* Storage override */
    MSGS *msgs;                        /* Messages override */
    char *since;
index 111691631b9f9eb9b17504bd67760702168677a1..6bf6965e22d02b4bf32c9db5aec02e4bb60b5667 100644 (file)
@@ -124,6 +124,18 @@ bool setup_job(JCR *jcr)
    }
    Dmsg0(50, "DB opened\n");
 
+   if (!jcr->fname) {
+      jcr->fname = get_pool_memory(PM_FNAME);
+   }
+   if (!jcr->pool_source) {
+      jcr->pool_source = get_pool_memory(PM_MESSAGE);
+      pm_strcpy(jcr->pool_source, _("unknown source"));
+   }
+   if (!jcr->storage_source) {
+      jcr->storage_source = get_pool_memory(PM_MESSAGE);
+      pm_strcpy(jcr->storage_source, _("unknown source"));
+   }
+
    /*
     * Create Job record
     */
@@ -147,15 +159,9 @@ bool setup_job(JCR *jcr)
    }
 
    Dmsg0(200, "Add jrc to work queue\n");
-
-
    return true;
 
 bail_out:
-   if (jcr->fname) {
-      free_memory(jcr->fname);
-      jcr->fname = NULL;
-   }
    return false;
 }
 
@@ -200,9 +206,6 @@ static void *job_thread(void *arg)
    generate_job_event(jcr, "JobInit");
    set_jcr_job_status(jcr, JS_Running);   /* this will be set only if no error */
 
-   if (!jcr->fname) {
-      jcr->fname = get_pool_memory(PM_FNAME);
-   }
 
    /*
     * Now, do pre-run stuff, like setting job level (Inc/diff, ...)
@@ -374,7 +377,7 @@ bool cancel_job(UAContext *ua, JCR *jcr)
       /* Cancel Storage daemon */
       if (jcr->store_bsock) {
          if (!ua->jcr->storage) {
-            copy_storage(ua->jcr, jcr->storage);
+            copy_storage(ua->jcr, jcr->storage, _("Job resource")); 
          } else {
             set_storage(ua->jcr, jcr->store);
          }
@@ -571,6 +574,73 @@ static bool job_check_maxruntime(JCR *control_jcr, JCR *jcr)
    return cancel;
 }
 
+/*
+ * Get or create a Pool record with the given name.
+ * Returns: 0 on error
+ *          poolid if OK
+ */
+DBId_t get_or_create_pool_record(JCR *jcr, char *pool_name)
+{
+   POOL_DBR pr;
+
+   memset(&pr, 0, sizeof(pr));
+   bstrncpy(pr.Name, pool_name, sizeof(pr.Name));
+
+   while (!db_get_pool_record(jcr, jcr->db, &pr)) { /* get by Name */
+      /* Try to create the pool */
+      if (create_pool(jcr, jcr->db, jcr->pool, POOL_OP_CREATE) < 0) {
+         Jmsg(jcr, M_FATAL, 0, _("Pool %s not in database. %s"), pr.Name,
+            db_strerror(jcr->db));
+         return 0;
+      } else {
+         Jmsg(jcr, M_INFO, 0, _("Pool %s created in database.\n"), pr.Name);
+      }
+   }
+   return pr.PoolId;
+}
+
+void apply_pool_overrides(JCR *jcr)
+{
+   if (jcr->run_pool_override) {
+      pm_strcat(jcr->pool_source, _("Run Pool override"));
+   }
+   /*
+    * Apply any level related Pool selections
+    */
+   switch (jcr->JobLevel) {
+   case L_FULL:
+      if (jcr->full_pool) {
+         jcr->pool = jcr->full_pool;
+         if (jcr->run_full_pool_override) {
+            pm_strcat(jcr->pool_source, _("Run FullPool override"));
+         } else {
+            pm_strcat(jcr->pool_source, _("Job FullPool override"));
+         }
+      }
+      break;
+   case L_INCREMENTAL:
+      if (jcr->inc_pool) {
+         jcr->pool = jcr->inc_pool;
+         if (jcr->run_inc_pool_override) {
+            pm_strcat(jcr->pool_source, _("Run IncPool override"));
+         } else {
+            pm_strcat(jcr->pool_source, _("Job IncPool override"));
+         }
+      }
+      break;
+   case L_DIFFERENTIAL:
+      if (jcr->diff_pool) {
+         jcr->pool = jcr->diff_pool;
+         if (jcr->run_diff_pool_override) {
+            pm_strcat(jcr->pool_source, _("Run DiffPool override"));
+         } else {
+            pm_strcat(jcr->pool_source, _("Job DiffPool override"));
+         }
+      }
+      break;
+   }
+}
+
 
 /*
  * Get or create a Client record for this Job
@@ -741,6 +811,14 @@ void dird_free_jcr_pointers(JCR *jcr)
       free_pool_memory(jcr->fname);
       jcr->fname = NULL;
    }
+   if (jcr->pool_source) {
+      free_pool_memory(jcr->pool_source);
+      jcr->pool_source = NULL;
+   }
+   if (jcr->storage_source) {
+      free_pool_memory(jcr->storage_source);
+      jcr->storage_source = NULL;
+   }
    if (jcr->stime) {
       Dmsg0(200, "Free JCR stime\n");
       free_pool_memory(jcr->stime);
@@ -807,18 +885,30 @@ void set_jcr_defaults(JCR *jcr, JOB *job)
       jcr->JobLevel = job->JobLevel;
       break;
    }
+   if (!jcr->fname) {
+      jcr->fname = get_pool_memory(PM_FNAME);
+   }
+   if (!jcr->pool_source) {
+      jcr->pool_source = get_pool_memory(PM_MESSAGE);
+      pm_strcpy(jcr->pool_source, _("unknown source"));
+   }
+   if (!jcr->storage_source) {
+      jcr->storage_source = get_pool_memory(PM_MESSAGE);
+      pm_strcpy(jcr->storage_source, _("unknown source"));
+   }
    jcr->JobPriority = job->Priority;
    /* Copy storage definitions -- deleted in dir_free_jcr above */
-   copy_storage(jcr, job->storage);
+   copy_storage(jcr, job->storage, _("Job resource"));
    jcr->client = job->client;
    if (!jcr->client_name) {
       jcr->client_name = get_pool_memory(PM_NAME);
    }
    pm_strcpy(jcr->client_name, jcr->client->hdr.name);
+   pm_strcpy(jcr->pool_source, _("Job resource"));
    jcr->pool = job->pool;
    jcr->full_pool = job->full_pool;
    jcr->inc_pool = job->inc_pool;
-   jcr->dif_pool = job->dif_pool;
+   jcr->diff_pool = job->diff_pool;
    jcr->catalog = job->client->catalog;
    jcr->fileset = job->fileset;
    jcr->messages = job->messages;
@@ -857,7 +947,7 @@ void set_jcr_defaults(JCR *jcr, JOB *job)
 /* 
  * Copy the storage definitions from an alist to the JCR
  */
-void copy_storage(JCR *jcr, alist *storage)
+void copy_storage(JCR *jcr, alist *storage, const char *where)
 {
    if (storage) {
       STORE *st;
@@ -868,6 +958,7 @@ void copy_storage(JCR *jcr, alist *storage)
       foreach_alist(st, storage) {
          jcr->storage->append(st);
       }
+      pm_strcpy(jcr->storage_source, where);
    }               
    if (jcr->storage) {
       jcr->store = (STORE *)jcr->storage->first();
index aa28b7cf34e417b1f837a2511ac607f881b323f8..1535aebc07410ccdd04d05cc415150506a51a9f0 100755 (executable)
@@ -519,7 +519,7 @@ void *jobq_server(void *arg)
             njcr->JobLevel = jcr->JobLevel;
             njcr->JobStatus = -1;
             set_jcr_job_status(njcr, jcr->JobStatus);
-            copy_storage(njcr, jcr->storage);
+            copy_storage(njcr, jcr->storage, _("previous Job"));
             njcr->messages = jcr->messages;
             Dmsg0(2300, "Call to run new job\n");
             V(jq->mutex);
index 5e5f52bf9fe5654e82b37aa6a28a6164d641c687..f37138bf72acdc29a05d1dc763921a6aa48a8ab4 100644 (file)
@@ -51,8 +51,6 @@ static void start_migration_job(JCR *jcr);
  */
 bool do_migration_init(JCR *jcr)
 {
-   POOL_DBR pr;
-
    /* If we find a job to migrate it is previous_jr.JobId */
    if (!get_job_to_migrate(jcr)) {
       return false;
@@ -66,43 +64,15 @@ bool do_migration_init(JCR *jcr)
       return false;
    }
 
-   /*
-    * Get the Pool record -- first apply any level defined pools
-    */
-   switch (jcr->previous_jr.JobLevel) {
-   case L_FULL:
-      if (jcr->full_pool) {
-         jcr->pool = jcr->full_pool;
-      }
-      break;
-   case L_INCREMENTAL:
-      if (jcr->inc_pool) {
-         jcr->pool = jcr->inc_pool;
-      }
-      break;
-   case L_DIFFERENTIAL:
-      if (jcr->dif_pool) {
-         jcr->pool = jcr->dif_pool;
-      }
-      break;
-   }
-   memset(&pr, 0, sizeof(pr));
-   bstrncpy(pr.Name, jcr->pool->hdr.name, sizeof(pr.Name));
+   apply_pool_overrides(jcr);
 
-   while (!db_get_pool_record(jcr, jcr->db, &pr)) { /* get by Name */
-      /* Try to create the pool */
-      if (create_pool(jcr, jcr->db, jcr->pool, POOL_OP_CREATE) < 0) {
-         Jmsg(jcr, M_FATAL, 0, _("Pool %s not in database. %s"), pr.Name,
-            db_strerror(jcr->db));
-         return false;
-      } else {
-         Jmsg(jcr, M_INFO, 0, _("Pool %s created in database.\n"), pr.Name);
-      }
+   jcr->jr.PoolId = get_or_create_pool_record(jcr, jcr->pool->hdr.name);
+   if (jcr->jr.PoolId == 0) {
+      return false;
    }
-   jcr->jr.PoolId = pr.PoolId;
 
    /* If pool storage specified, use it instead of job storage */
-   copy_storage(jcr, jcr->pool->storage);
+   copy_storage(jcr, jcr->pool->storage, _("Pool resource"));
 
    if (!jcr->storage) {
       Jmsg(jcr, M_FATAL, 0, _("No Storage specification found in Job or Pool.\n"));
@@ -193,35 +163,27 @@ bool do_migration(JCR *jcr)
    /* ***FIXME*** */
 
    /* If pool storage specified, use it for restore */
-   copy_storage(prev_jcr, pool->storage);
+   copy_storage(prev_jcr, pool->storage, _("Pool resource"));
 
    /* If the original backup pool has a NextPool, make sure a 
     *  record exists in the database.
     */
    if (pool->NextPool) {
-      memset(&pr, 0, sizeof(pr));
-      bstrncpy(pr.Name, pool->NextPool->hdr.name, sizeof(pr.Name));
-
-      while (!db_get_pool_record(jcr, jcr->db, &pr)) { /* get by Name */
-         /* Try to create the pool */
-         if (create_pool(jcr, jcr->db, pool->NextPool, POOL_OP_CREATE) < 0) {
-            Jmsg(jcr, M_FATAL, 0, _("Pool \"%s\" not in database. %s"), pr.Name,
-               db_strerror(jcr->db));
-            return false;
-         } else {
-            Jmsg(jcr, M_INFO, 0, _("Pool \"%s\" created in database.\n"), pr.Name);
-         }
+      jcr->jr.PoolId = get_or_create_pool_record(jcr, pool->NextPool->hdr.name);
+      if (jcr->jr.PoolId == 0) {
+         return false;
       }
       /*
        * put the "NextPool" resource pointer in our jcr so that we
        * can pull the Storage reference from it.
        */
       prev_jcr->pool = jcr->pool = pool->NextPool;
-      prev_jcr->jr.PoolId = jcr->jr.PoolId = pr.PoolId;
+      prev_jcr->jr.PoolId = jcr->jr.PoolId;
+      pm_strcpy(jcr->pool_source, _("NextPool in Pool resource"));
    }
 
    /* If pool storage specified, use it instead of job storage for backup */
-   copy_storage(jcr, jcr->pool->storage);
+   copy_storage(jcr, jcr->pool->storage, _("Pool resource"));
 
    /* Print Job Start message */
    Jmsg(jcr, M_INFO, 0, _("Start Migration JobId %s, Job=%s\n"),
@@ -676,15 +638,21 @@ void migration_cleanup(JCR *jcr, int TermCode)
    set_jcr_job_status(jcr, TermCode);
    update_job_end_record(jcr);        /* update database */
 
-   /* Check if we actually did something */
+   /* 
+    * Check if we actually did something.  
+    *  prev_jcr is jcr of the newly migrated job.
+    */
    if (prev_jcr) {
       prev_jcr->JobFiles = jcr->JobFiles = jcr->SDJobFiles;
       prev_jcr->JobBytes = jcr->JobBytes = jcr->SDJobBytes;
       prev_jcr->VolSessionId = jcr->VolSessionId;
       prev_jcr->VolSessionTime = jcr->VolSessionTime;
+      prev_jcr->jr.RealEndTime = 0; 
+      prev_jcr->jr.PriorJobId = jcr->previous_jr.JobId;
 
       set_jcr_job_status(prev_jcr, TermCode);
 
+  
       update_job_end_record(prev_jcr);
 
       Mmsg(query, "UPDATE Job SET StartTime='%s',EndTime='%s',"
@@ -725,36 +693,36 @@ void migration_cleanup(JCR *jcr, int TermCode)
 
    msg_type = M_INFO;                 /* by default INFO message */
    switch (jcr->JobStatus) {
-      case JS_Terminated:
-         if (jcr->Errors || jcr->SDErrors) {
-            term_msg = _("%s OK -- with warnings");
-         } else {
-            term_msg = _("%s OK");
-         }
-         break;
-      case JS_FatalError:
-      case JS_ErrorTerminated:
-         term_msg = _("*** %s Error ***");
-         msg_type = M_ERROR;          /* Generate error message */
-         if (jcr->store_bsock) {
-            bnet_sig(jcr->store_bsock, BNET_TERMINATE);
-            if (jcr->SD_msg_chan) {
-               pthread_cancel(jcr->SD_msg_chan);
-            }
+   case JS_Terminated:
+      if (jcr->Errors || jcr->SDErrors) {
+         term_msg = _("%s OK -- with warnings");
+      } else {
+         term_msg = _("%s OK");
+      }
+      break;
+   case JS_FatalError:
+   case JS_ErrorTerminated:
+      term_msg = _("*** %s Error ***");
+      msg_type = M_ERROR;          /* Generate error message */
+      if (jcr->store_bsock) {
+         bnet_sig(jcr->store_bsock, BNET_TERMINATE);
+         if (jcr->SD_msg_chan) {
+            pthread_cancel(jcr->SD_msg_chan);
          }
-         break;
-      case JS_Canceled:
-         term_msg = _("%s Canceled");
-         if (jcr->store_bsock) {
-            bnet_sig(jcr->store_bsock, BNET_TERMINATE);
-            if (jcr->SD_msg_chan) {
-               pthread_cancel(jcr->SD_msg_chan);
-            }
+      }
+      break;
+   case JS_Canceled:
+      term_msg = _("%s Canceled");
+      if (jcr->store_bsock) {
+         bnet_sig(jcr->store_bsock, BNET_TERMINATE);
+         if (jcr->SD_msg_chan) {
+            pthread_cancel(jcr->SD_msg_chan);
          }
-         break;
-      default:
-         term_msg = _("Inappropriate %s term code");
-         break;
+      }
+      break;
+   default:
+      term_msg = _("Inappropriate %s term code");
+      break;
    }
    bsnprintf(term_code, sizeof(term_code), term_msg, "Migration");
    bstrftimes(sdt, sizeof(sdt), jcr->jr.StartTime);
@@ -777,7 +745,8 @@ void migration_cleanup(JCR *jcr, int TermCode)
 "  Backup Level:           %s%s\n"
 "  Client:                 %s\n"
 "  FileSet:                \"%s\" %s\n"
-"  Pool:                   \"%s\"\n"
+"  Pool:                   \"%s\" (From %s)\n"
+"  Storage:                \"%s\" (From %s)\n"
 "  Start time:             %s\n"
 "  End time:               %s\n"
 "  Elapsed time:           %s\n"
@@ -802,7 +771,8 @@ void migration_cleanup(JCR *jcr, int TermCode)
         level_to_str(jcr->JobLevel), jcr->since,
         jcr->client->hdr.name,
         jcr->fileset->hdr.name, jcr->FSCreateTime,
-        jcr->pool->hdr.name,
+        jcr->pool->hdr.name, jcr->pool_source,
+        jcr->store->hdr.name, jcr->storage_source,
         sdt,
         edt,
         edit_utime(RunTime, elapsed, sizeof(elapsed)),
index a687bb40657e784553e6cc34746f08c6ceef1f8e..0658a0767c2eccacd9cec152485ace081daccd9c 100644 (file)
@@ -94,10 +94,12 @@ extern void create_unique_job_name(JCR *jcr, const char *base_name);
 extern void update_job_end_record(JCR *jcr);
 extern bool get_or_create_client_record(JCR *jcr);
 extern bool get_or_create_fileset_record(JCR *jcr);
+extern DBId_t get_or_create_pool_record(JCR *jcr, char *pool_name);
+extern void apply_pool_overrides(JCR *jcr);
 extern JobId_t run_job(JCR *jcr);
 extern bool cancel_job(UAContext *ua, JCR *jcr);
 extern void init_jcr_job_record(JCR *jcr);
-extern void copy_storage(JCR *jcr, alist *storage);
+extern void copy_storage(JCR *jcr, alist *storage, const char *where);
 extern void set_storage(JCR *jcr, STORE *store);
 extern bool setup_job(JCR *jcr);
 extern void create_clones(JCR *jcr);
index 162b4945e5825f6428fab63eab1b75746cdfaa63..acae9b28857a4b6ee73824cccf46a9ee6c5c0d05 100644 (file)
@@ -257,7 +257,7 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass)
                      lrun.inc_pool = (POOL *)res;
                      break;
                   case 'd':
-                     lrun.dif_pool = (POOL *)res;
+                     lrun.diff_pool = (POOL *)res;
                      break;
                   }
                }
index 83bdcdea0eeb6af6618e4f63bfcd1ccd301bd092..498bef71f7f20c817ccbfd2b897a972b557aadc7 100644 (file)
@@ -190,15 +190,19 @@ again:
    }
    if (run->pool) {
       jcr->pool = run->pool;          /* override pool */
+      jcr->run_pool_override = true;
    }
    if (run->full_pool) {
       jcr->full_pool = run->full_pool; /* override full pool */
+      jcr->run_full_pool_override = true;
    }
    if (run->inc_pool) {
       jcr->inc_pool = run->inc_pool;  /* override inc pool */
+      jcr->run_inc_pool_override = true;
    }
-   if (run->dif_pool) {
-      jcr->dif_pool = run->dif_pool;  /* override dif pool */
+   if (run->diff_pool) {
+      jcr->diff_pool = run->diff_pool;  /* override dif pool */
+      jcr->run_diff_pool_override = true;
    }
    if (run->storage) {
       set_storage(jcr, run->storage); /* override storage */
index 97d3253d4ccd76505fb5fc58e9c684e316b39363..625f6111540a8a343b0fbd6ea99fc70219ea5de9 100644 (file)
@@ -190,7 +190,11 @@ public:
    POOL *pool;                        /* Pool resource */
    POOL *full_pool;                   /* Full backup pool resource */
    POOL *inc_pool;                    /* Incremental backup pool resource */
-   POOL *dif_pool;                    /* Differential backup pool resource */
+   POOL *diff_pool;                    /* Differential backup pool resource */
+   bool run_pool_override;
+   bool run_full_pool_override;
+   bool run_inc_pool_override;
+   bool run_diff_pool_override;
    FILESET *fileset;                  /* FileSet resource */
    CAT *catalog;                      /* Catalog resource */
    MSGS *messages;                    /* Default message handler */
@@ -215,6 +219,8 @@ public:
       JobId_t MigrateJobId;
    };
    POOLMEM *client_uname;             /* client uname */
+   POOLMEM *pool_source;              /* Where pool came from */
+   POOLMEM *storage_source;           /* Where storage came from */
    int replace;                       /* Replace option */
    int NumVols;                       /* Number of Volume used in pool */
    int reschedule_count;              /* Number of times rescheduled */
index a9c8cf99fea4e56c0a860ea00a0564d0fdba652f..2a5271b5fc4ed52514d8c97638a4c41c75ce6151 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.14"
-#define BDATE   "24 June 2006"
-#define LSMDATE "24Jun06"
+#define BDATE   "26 June 2006"
+#define LSMDATE "26Jun06"
 
 /* Debug flags */
 #undef  DEBUG