]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_output.c
- Correct typo in Copyright
[bacula/bacula] / bacula / src / dird / ua_output.c
index af30220093696ad70955b73140c266e850a1b0bc..09f44df8b4cde99034572626af31919e0903d502 100644 (file)
@@ -9,22 +9,17 @@
  */
 
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Copyright (C) 2000-2005 Kern Sibbald
 
    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.
+   modify it under the terms of the GNU General Public License
+   version 2 as amended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    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., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
@@ -262,6 +257,11 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist)
    for (i=1; i<ua->argc; i++) {
       /* List JOBS */
       if (strcasecmp(ua->argk[i], _("jobs")) == 0) {
+        /* Apply any limit */
+         j = find_arg_with_value(ua, _("limit"));
+        if (j >= 0) {
+           jr.limit = atoi(ua->argv[j]);
+        }
         db_list_job_records(ua->jcr, ua->db, &jr, prtit, ua, llist);
 
         /* List JOBTOTALS */
@@ -403,6 +403,8 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist)
       } else if (strcasecmp(ua->argk[i], _("nextvol")) == 0 ||
                  strcasecmp(ua->argk[i], _("nextvolume")) == 0) {
         list_nextvol(ua);
+      } else if (strcasecmp(ua->argk[i], _("limit")) == 0) {
+        /* Ignore it */
       } else {
          bsendmsg(ua, _("Unknown list keyword: %s\n"), NPRT(ua->argk[i]));
       }
@@ -421,7 +423,6 @@ static bool list_nextvol(UAContext *ua)
    MEDIA_DBR mr;
 
    memset(&mr, 0, sizeof(mr));
-   mr.PoolId = jcr->PoolId;
    int i = find_arg_with_value(ua, "job");
    if (i <= 0) {
       if ((job = select_job_resource(ua)) == NULL) {
@@ -437,11 +438,14 @@ static bool list_nextvol(UAContext *ua)
       }
    }
    for (run=NULL; (run = find_next_run(run, job, runtime)); ) {
-      pool = run ? run->pool : NULL;
+      pool = run->pool ? run->pool : NULL;
       if (!complete_jcr_for_job(jcr, job, pool)) {
         return false;
       }
-
+      mr.PoolId = jcr->PoolId;
+      if (run->storage) {
+        jcr->store = run->storage;
+      }
       if (!find_next_volume_for_append(jcr, &mr, 0)) {
          bsendmsg(ua, _("Could not find next Volume.\n"));
       } else {