]> git.sur5r.net Git - bacula/bacula/commitdiff
Misc
authorKern Sibbald <kern@sibbald.com>
Tue, 11 Feb 2003 11:08:17 +0000 (11:08 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 11 Feb 2003 11:08:17 +0000 (11:08 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@342 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/dird/ua.h
bacula/src/dird/ua_run.c
bacula/src/dird/ua_select.c
bacula/src/stored/dircmd.c
bacula/src/tools/dbcheck.c

index c87c9df56a505e96de0523c9b94c9fcc856b0e4a..cd8826152440e3c3ec8b879a4f7ac5f2dfe2d2f1 100644 (file)
@@ -16,8 +16,7 @@ Testing to do: (painful)
 - multiple simultaneous Volumes
 
 For 1.30 release:
-- Change stat1= fgets()!=NULL to stat1=fgest()==NULL; in 
-  run_program -- bpipe.c
+- Add chflags() code for FreeBSD file flags
 - Add RunBeforeJob and RunAfterJob to the Client program.
 - Have SD compute MD5 or SHA1 and compare to what FD computes.
 - Make VolumeToCatalog calculate an MD5 or SHA1 from the 
@@ -837,3 +836,6 @@ Done: (see kernsdone for more)
 - Implement multiple simultaneous file Volumes on a single device.
 - Cleanup db_update_media and db_update_pool
 - Flush all the daemon messages at the end of every job.
+- Change stat1= fgets()!=NULL to stat1=fgest()==NULL; in 
+  run_program -- bpipe.c
+
index 98c53dfceace4c8b8d18754376b838adb754c3ef..8180d63dee67fcabf2c395498f5fa9893203c783 100644 (file)
@@ -85,6 +85,7 @@ int   get_media_type(UAContext *ua, char *MediaType, int max_media);
 int    get_pool_dbr(UAContext *ua, POOL_DBR *pr);
 int    get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
 POOL   *get_pool_resource(UAContext *ua);
+POOL   *select_pool_resource(UAContext *ua);
 CLIENT *get_client_resource(UAContext *ua);
 int    get_job_dbr(UAContext *ua, JOB_DBR *jr);
 
index 810cd1b4161ed6345f839d1503e6d191368ef862..c46429ff94f1835188c6aa6b90a30e640ef04c58 100644 (file)
@@ -49,13 +49,14 @@ extern struct s_kw ReplaceOptions[];
 int runcmd(UAContext *ua, char *cmd)
 {
    JCR *jcr;
-   char *job_name, *level_name, *jid, *store_name;
+   char *job_name, *level_name, *jid, *store_name, *pool_name;
    char *where, *fileset_name, *client_name, *bootstrap, *replace;
    int i, j, found, opt;
    JOB *job = NULL;
    STORE *store = NULL;
    CLIENT *client = NULL;
    FILESET *fileset = NULL;
+   POOL *pool = NULL;
    static char *kw[] = {
       N_("job"),
       N_("jobid"),
@@ -63,6 +64,7 @@ int runcmd(UAContext *ua, char *cmd)
       N_("fileset"),
       N_("level"),
       N_("storage"),
+      N_("pool"), 
       N_("where"),
       N_("bootstrap"),
       N_("replace"),
@@ -76,6 +78,7 @@ int runcmd(UAContext *ua, char *cmd)
    level_name = NULL;
    jid = NULL;
    store_name = NULL;
+   pool_name = NULL;
    where = NULL;
    client_name = NULL;
    fileset_name = NULL;
@@ -141,7 +144,15 @@ int runcmd(UAContext *ua, char *cmd)
                  store_name = ua->argv[i];
                  found = True;
                  break;
-              case 6: /* where */
+              case 6: /* pool */
+                 if (pool_name) {
+                     bsendmsg(ua, _("Pool specified twice.\n"));
+                    return 1;
+                 }
+                 pool_name = ua->argv[i];
+                 found = True;
+                 break;
+              case 7: /* where */
                  if (where) {
                      bsendmsg(ua, _("Where specified twice.\n"));
                     return 1;
@@ -149,7 +160,7 @@ int runcmd(UAContext *ua, char *cmd)
                  where = ua->argv[i];
                  found = True;
                  break;
-              case 7: /* bootstrap */
+              case 8: /* bootstrap */
                  if (bootstrap) {
                      bsendmsg(ua, _("Bootstrap specified twice.\n"));
                     return 1;
@@ -157,7 +168,7 @@ int runcmd(UAContext *ua, char *cmd)
                  bootstrap = ua->argv[i];
                  found = True;
                  break;
-              case 8: /* replace */
+              case 9: /* replace */
                  if (replace) {
                      bsendmsg(ua, _("Replace specified twice.\n"));
                     return 1;
@@ -220,6 +231,17 @@ int runcmd(UAContext *ua, char *cmd)
       return 1;
    }
 
+
+   if (pool_name) {
+      pool = (POOL *)GetResWithName(R_POOL, pool_name);
+      if (!pool) {
+         bsendmsg(ua, _("Pool \"%s\" not found.\n"), pool_name);
+        pool = get_pool_resource(ua);
+      }
+   } else {
+      pool = job->pool;            /* use default */
+   }
+
    if (client_name) {
       client = (CLIENT *)GetResWithName(R_CLIENT, client_name);
       if (!client) {
@@ -254,6 +276,7 @@ int runcmd(UAContext *ua, char *cmd)
    jcr->store = store;
    jcr->client = client;
    jcr->fileset = fileset;
+   jcr->pool = pool;
    if (where) {
       if (jcr->RestoreWhere) {
         free(jcr->RestoreWhere);
@@ -331,13 +354,15 @@ JobName:  %s\n\
 FileSet:  %s\n\
 Level:    %s\n\
 Client:   %s\n\
-Storage:  %s\n"),
+Storage:  %s\n\
+Pool:     %s\n"),
                  jcr->JobType==JT_BACKUP?_("Backup"):_("Verify"),
                 job->hdr.name,
                 jcr->fileset->hdr.name,
                 level_to_str(jcr->JobLevel),
                 jcr->client->hdr.name,
-                jcr->store->hdr.name);
+                jcr->store->hdr.name,
+                NPRT(jcr->pool->hdr.name));
         break;
       case JT_RESTORE:
         if (jcr->RestoreJobId == 0 && !jcr->RestoreBootstrap) {
@@ -397,7 +422,10 @@ JobId:      %s\n"),
       add_prompt(ua, _("Job"));              /* 2 */
       add_prompt(ua, _("FileSet"));          /* 3 */
       add_prompt(ua, _("Client"));           /* 4 */
-      if (jcr->JobType == JT_RESTORE) {
+      if (jcr->JobType == JT_BACKUP ||
+         jcr->JobType == JT_VERIFY) {
+         add_prompt(ua, _("Pool"));          /* 5 */
+      } else if (jcr->JobType == JT_RESTORE) {
          add_prompt(ua, _("Bootstrap"));     /* 5 */
          add_prompt(ua, _("Where"));         /* 6 */
          add_prompt(ua, _("Replace"));       /* 7 */
@@ -488,6 +516,16 @@ JobId:      %s\n"),
         }
         break;
       case 5:
+        if (jcr->JobType == JT_BACKUP ||
+            jcr->JobType == JT_VERIFY) {      /* Pool */
+           pool = select_pool_resource(ua);
+           if (pool) {
+              jcr->pool = pool;
+              goto try_again;
+           }
+           break;
+        }
+
         /* Bootstrap */
          if (!get_cmd(ua, _("Please enter the Bootstrap file name: "))) {
            break;
index c88e07d72abad43a8ff3b9e6aaad1061d5b51bc2..16b668233c99529bfe08cecc2d59f6f2dcab9ea3 100644 (file)
@@ -465,8 +465,26 @@ int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr)
 }
 
 
+/* 
+ * Select a pool resource from prompt list
+ */
+POOL *select_pool_resource(UAContext *ua)
+{
+   char name[MAX_NAME_LENGTH];   
+   POOL *pool = NULL;
+
+   start_prompt(ua, _("The defined Pool resources are:\n"));
+   LockRes();
+   while ((pool = (POOL *)GetNextRes(R_POOL, (RES *)pool))) {
+      add_prompt(ua, pool->hdr.name);
+   }
+   UnlockRes();
+   do_prompt(ua, _("Select Pool resource"), name, sizeof(name));
+   pool = (POOL *)GetResWithName(R_POOL, name);
+}
+
+
 /*
- *  This routine is ONLY used in the create command.
  *  If you are thinking about using it, you
  *  probably want to use select_pool_dbr() 
  *  or get_pool_dbr() above.
@@ -487,15 +505,7 @@ POOL *get_pool_resource(UAContext *ua)
         break;
       }
    }
-   start_prompt(ua, _("The defined Pool resources are:\n"));
-   LockRes();
-   while ((pool = (POOL *)GetNextRes(R_POOL, (RES *)pool))) {
-      add_prompt(ua, pool->hdr.name);
-   }
-   UnlockRes();
-   do_prompt(ua, _("Select Pool resource"), name, sizeof(name));
-   pool = (POOL *)GetResWithName(R_POOL, name);
-   return pool;
+   return select_pool_resource(ua);
 }
 
 /*
index 961c8bd2a12605fa8abf576d481c053841d0425b..4e49725dae35650ea118a182c9b4a5935fca05a6 100644 (file)
@@ -645,8 +645,7 @@ static int status_cmd(JCR *jcr)
 
    LockRes();
    for (device=NULL;  (device=(DEVRES *)GetNextRes(R_DEVICE, (RES *)device)); ) {
-      dev = device->dev;
-      if (dev) {
+      for (dev=device->dev; dev; dev=dev->next) {
         if (dev->state & ST_OPENED) {
            if (dev->state & ST_LABEL) {
                bnet_fsend(user, _("Device %s is mounted with Volume %s\n"), 
@@ -685,10 +684,11 @@ static int status_cmd(JCR *jcr)
            job_type_to_str(jcr->JobType), jcr->Job);
       }
       if (jcr->device) {
-         bnet_fsend(user, _("%s %s job %s is using device %s\n"), 
+         bnet_fsend(user, _("%s %s job %s is using device %s volume %s\n"), 
                   job_level_to_str(jcr->JobLevel),
                   job_type_to_str(jcr->JobType),
-                  jcr->Job, jcr->device->device_name);
+                  jcr->Job, jcr->device->device_name,
+                  jcr->VolumeName);
         sec = time(NULL) - jcr->run_time;
         if (sec <= 0) {
            sec = 1;
index 57d316c916b1989f76286265f9125d74c5a933db..e598ce19ae2045c1e72eaf15d5c30046d2437eea 100644 (file)
@@ -442,7 +442,7 @@ static void eliminate_duplicate_filenames()
       exit(1);
    }
    printf("Found %d duplicate Filename records.\n", name_list.num_ids);
-   if (verbose && yes_no("Print the list? (yes/no): ")) {
+   if (name_list.num_ids && verbose && yes_no("Print the list? (yes/no): ")) {
       print_name_list(&name_list);
    }
    if (fix) {