]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/status.c
Extend idea of Prefer Mounted Volumes to mean a volume about
[bacula/bacula] / bacula / src / stored / status.c
index 1e2916e6e62deb09e2aa5dbbca66d1b14b2f5d30..091cb6278fcb217a4641888c9eda4214989828d8 100644 (file)
@@ -1,3 +1,30 @@
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2003-2007 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.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   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.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 /*
  *  This file handles the status command
  *
@@ -6,20 +33,6 @@
  *   Version $Id$
  *
  */
-/*
-   Copyright (C) 2003-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
-   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 
-   the file LICENSE for additional details.
-
- */
 
 #include "bacula.h"
 #include "stored.h"
@@ -124,7 +137,7 @@ void output_status(void sendit(const char *msg, int len, void *sarg), void *arg)
                dev->pool_name[0]?dev->pool_name:"*unknown*");
             sendit(msg, len, arg);
          } else {
-            len = Mmsg(msg, _("Device %s open but no Bacula volume is mounted.\n"), 
+            len = Mmsg(msg, _("Device %s open but no Bacula volume is currently mounted.\n"), 
                dev->print_name());
             sendit(msg, len, arg);
          }
@@ -204,7 +217,7 @@ static void send_blocked_status(DEVICE *dev, void sendit(const char *msg, int le
       free_pool_memory(msg);
       return;
    }
-   switch (dev->dev_blocked) {
+   switch (dev->blocked()) {
    case BST_UNMOUNTED:
       len = Mmsg(msg, _("    Device is BLOCKED. User unmounted.\n"));
       sendit(msg, len, arg);
@@ -299,7 +312,7 @@ static void send_blocked_status(DEVICE *dev, void sendit(const char *msg, int le
          dev->state & ST_MOUNTED ? "" : "!");
       sendit(msg, len, arg);
 
-      len = Mmsg(msg, _("num_writers=%d block=%d\n\n"), dev->num_writers, dev->dev_blocked);
+      len = Mmsg(msg, _("num_writers=%d block=%d\n\n"), dev->num_writers, dev->blocked());
       sendit(msg, len, arg);
 
       len = Mmsg(msg, _("Device parameters:\n"));
@@ -353,7 +366,7 @@ static void list_running_jobs(void sendit(const char *msg, int len, void *sarg),
          }
          if (rdcr && rdcr->device) {
             len = Mmsg(msg, _("Reading: %s %s job %s JobId=%d Volume=\"%s\"\n"
-                            "    pool=\"%s\" device=\"%s\"\n"),
+                            "    pool=\"%s\" device=%s\n"),
                    job_level_to_str(jcr->JobLevel),
                    job_type_to_str(jcr->JobType),
                    JobName,
@@ -366,7 +379,7 @@ static void list_running_jobs(void sendit(const char *msg, int len, void *sarg),
          }
          if (dcr && dcr->device) {
             len = Mmsg(msg, _("Writing: %s %s job %s JobId=%d Volume=\"%s\"\n"
-                            "    pool=\"%s\" device=\"%s\"\n"),
+                            "    pool=\"%s\" device=%s\n"),
                    job_level_to_str(jcr->JobLevel),
                    job_type_to_str(jcr->JobType),
                    JobName,
@@ -376,6 +389,9 @@ static void list_running_jobs(void sendit(const char *msg, int len, void *sarg),
                    dcr->dev?dcr->dev->print_name(): 
                             dcr->device->device_name);
             sendit(msg, len, arg);
+            len= Mmsg(msg, _("    spooling=%d despooling=%d despool_wait=%d\n"),
+                   dcr->spooling, dcr->despooling, dcr->despool_wait);
+            sendit(msg, len, arg);
          }
          sec = time(NULL) - jcr->run_time;
          if (sec <= 0) {
@@ -404,6 +420,10 @@ static void list_running_jobs(void sendit(const char *msg, int len, void *sarg),
    }
    endeach_jcr(jcr);
 
+   if (!found) {
+      len = Mmsg(msg, _("No Jobs running.\n"));
+      sendit(msg, len, arg);
+   }
    sendit("====\n", 5, arg);
 
    free_pool_memory(msg);