]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix UseDuration (hopefully)
authorKern Sibbald <kern@sibbald.com>
Sun, 12 Jan 2003 20:32:24 +0000 (20:32 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 12 Jan 2003 20:32:24 +0000 (20:32 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@281 91ce42f0-d328-0410-95d8-f526ca767f89

22 files changed:
bacula/kernstodo
bacula/src/cats/sql_find.c
bacula/src/cats/sql_get.c
bacula/src/cats/sql_update.c
bacula/src/dird/catreq.c
bacula/src/dird/ua_input.c
bacula/src/filed/backup.c
bacula/src/filed/restore.c
bacula/src/filed/status.c
bacula/src/filed/verify.c
bacula/src/filed/verify_vol.c
bacula/src/findlib/find.c
bacula/src/findlib/find_one.c
bacula/src/findlib/protos.h
bacula/src/lib/btime.c
bacula/src/stored/acquire.c
bacula/src/stored/askdir.c
bacula/src/stored/block.c
bacula/src/stored/device.c
bacula/src/stored/mount.c
bacula/src/tools/testfind.c
bacula/src/version.h

index f40b28094e66d50794c6ba4d79f1800fbe78b2aa..778e24907e803cdfc6b9f9060dccaaeac5486088 100644 (file)
@@ -1,5 +1,5 @@
                  Kern's ToDo List
-                 08 January 2003 
+                 11 January 2003 
 
 Documentation to do: (a little bit at a time)
 - Document running a test version.
@@ -16,6 +16,16 @@ Testing to do: (painful)
 - test and fix < code and | code.
 
 For 1.29 release:
+- Why is catreq.c:111 Find vol called twice for a job?
+- Why is FirstWritten = -1 after label?
+- Add include list to end of chain in findlib
+- Fix cancel in find_one -- need jcr.
+- Write SetJobStatus() function so cancel status not lost.
+- Find out why Full saves run slower and slower (hashing?)
+- Test size of hash table needed in find_one using testfind.
+- Make 1.28c release
+- Rewrite find_one.c to use only pool_memory instead of 
+  alloca and malloc.
 - Make sure btraceback goes into /sbin not sysconf directory.
 - Get correct error status from run_program or open_bpipe().
 - Figure out how to allow multiple simultaneous file Volumes on
index 7f333f4f48520ab7e5dce4430d150fc5f4c51343..c8ebb262ee7b8b08a550b603bdbc8849905eb00c 100644 (file)
@@ -206,7 +206,8 @@ db_find_next_volume(B_DB *mdb, int item, MEDIA_DBR *mr)
    Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\
 VolBytes,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,\
 VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,Recycle,Slot,\
-FirstWritten FROM Media WHERE PoolId=%d AND MediaType='%s' AND VolStatus='%s' \
+FirstWritten,LastWritten \
+FROM Media WHERE PoolId=%d AND MediaType='%s' AND VolStatus='%s' \
 ORDER BY MediaId", mr->PoolId, mr->MediaType, mr->VolStatus); 
 
    if (!QUERY_DB(mdb, mdb->cmd)) {
@@ -253,6 +254,9 @@ ORDER BY MediaId", mr->PoolId, mr->MediaType, mr->VolStatus);
    mr->Recycle = str_to_int64(row[15]);
    mr->Slot = str_to_int64(row[16]);
    bstrncpy(mr->cFirstWritten, row[17]!=NULL?row[17]:"", sizeof(mr->cFirstWritten));
+   mr->FirstWritten = (time_t)str_to_utime(mr->cFirstWritten);
+   bstrncpy(mr->cLastWritten, row[18]!=NULL?row[18]:"", sizeof(mr->cLastWritten));
+   mr->LastWritten = (time_t)str_to_utime(mr->cLastWritten);
 
    sql_free_result(mdb);
 
index 197adfc372e3e60ee9193698f1bd635af57b69d2..947e980185f0a0b7ac3d736a8c8785b6b73b0749 100644 (file)
@@ -795,13 +795,13 @@ int db_get_media_record(B_DB *mdb, MEDIA_DBR *mr)
       Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\
 VolBytes,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,\
 MediaType,VolStatus,PoolId,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,\
-Recycle,Slot, FirstWritten \
+Recycle,Slot,FirstWritten,LastWritten \
 FROM Media WHERE MediaId=%d", mr->MediaId);
    } else {                          /* find by name */
       Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\
 VolBytes,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,\
 MediaType,VolStatus,PoolId,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,\
-Recycle,Slot,FirstWritten \
+Recycle,Slot,FirstWritten,LastWritten \
 FROM Media WHERE VolumeName='%s'", mr->VolumeName);
    }  
 
@@ -839,6 +839,9 @@ FROM Media WHERE VolumeName='%s'", mr->VolumeName);
            mr->Recycle = str_to_int64(row[18]);
            mr->Slot = str_to_int64(row[19]);
             bstrncpy(mr->cFirstWritten, row[20]!=NULL?row[20]:"", sizeof(mr->cFirstWritten));
+           mr->FirstWritten = (time_t)str_to_utime(mr->cFirstWritten);
+            bstrncpy(mr->cLastWritten, row[21]!=NULL?row[21]:"", sizeof(mr->cLastWritten));
+           mr->LastWritten = (time_t)str_to_utime(mr->cLastWritten);
            stat = mr->MediaId;
         }
       } else {
index cc76d0675194ce13c71abd887dfbdc09e3d4fe2c..1f2ca28f21b28fc65251ed03fe7fe0f951b9f70e 100644 (file)
@@ -183,7 +183,7 @@ db_update_pool_record(B_DB *mdb, POOL_DBR *pr)
 int
 db_update_media_record(B_DB *mdb, MEDIA_DBR *mr) 
 {
-   char dt[MAX_TIME_LENGTH];
+   char dt[MAX_TIME_LENGTH], dtF[MAX_TIME_LENGTH];
    time_t ttime;
    struct tm tm;
    int stat;
@@ -195,10 +195,13 @@ db_update_media_record(B_DB *mdb, MEDIA_DBR *mr)
 
    Dmsg1(100, "update_media: FirstWritten=%d\n", mr->FirstWritten);
    db_lock(mdb);
-   if (mr->VolMounts == 1 && mr->VolBlocks==1 && mr->VolWrites==1) {
+   if (mr->VolJobs == 1) {
       Dmsg1(400, "Set FirstWritten Vol=%s\n", mr->VolumeName);
+      ttime = mr->FirstWritten;
+      localtime_r(&ttime, &tm);
+      strftime(dtF, sizeof(dtF), "%Y-%m-%d %T", &tm);
       Mmsg(&mdb->cmd, "UPDATE Media SET FirstWritten='%s'\
- WHERE VolumeName='%s'", dt, mr->VolumeName);
+ WHERE VolumeName='%s'", dtF, mr->VolumeName);
       stat = UPDATE_DB(mdb, mdb->cmd);
       Dmsg1(400, "Firstwritten stat=%d\n", stat);
    }
index bdb854233445853db2451592473fd3cc1c22362e..e68ef0a2590d528484edae7556559fdb1626fe4f 100644 (file)
@@ -108,13 +108,14 @@ next_volume:
         }
       }
       /* Check if use duration has expired */
-      if (ok && mr.VolUseDuration > 0 && 
-                strcmp(mr.VolStatus, "Recycle") != 0) {
+      Dmsg2(200, "VolJobs=%d FirstWritten=%d\n", mr.VolJobs, mr.FirstWritten);
+      if (ok && mr.VolJobs > 0 && mr.VolUseDuration > 0 && 
+           strcmp(mr.VolStatus, "Recycle") != 0) {
         utime_t now = time(NULL);
-        utime_t start = str_to_utime(mr.cFirstWritten);                         
-        if (start > 0 && mr.VolUseDuration <= (now - start)) {
+        if (mr.VolUseDuration <= (now - mr.FirstWritten)) {
             Dmsg4(100, "Duration=%d now=%d start=%d now-start=%d\n",
-              (int)jcr->pool->VolUseDuration, (int)now, (int)start, (int)(now-start));
+              (int)jcr->pool->VolUseDuration, (int)now, (int)mr.FirstWritten, 
+              (int)(now-mr.FirstWritten));
             Jmsg(jcr, M_INFO, 0, _("Max configured use duration exceeded. "       
                "Marking Volume \"%s\" as Used.\n"), mr.VolumeName);
             strcpy(mr.VolStatus, "Used");  /* yes, mark as used */
@@ -145,6 +146,7 @@ next_volume:
            edit_uint64(mr.MaxVolBytes, ed2), 
            edit_uint64(mr.VolCapacityBytes, ed3),
            mr.VolStatus, mr.Slot, mr.MaxVolJobs, mr.MaxVolFiles);
+         Dmsg1(200, "Find media: %s", bs->msg);
       } else {
          bnet_fsend(bs, "1999 No Media\n");
       }
@@ -191,8 +193,7 @@ next_volume:
               edit_uint64(mr.MaxVolBytes, ed2), 
               edit_uint64(mr.VolCapacityBytes, ed3),
               mr.VolStatus, mr.Slot, mr.MaxVolJobs, mr.MaxVolFiles);
-            Dmsg5(200, "get_media_record PoolId=%d wanted %d, Status=%s, Slot=%d \
-MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.Slot, mr.MediaType);
+            Dmsg1(200, "Vol Info: %s", bs->msg);
         } else { 
            /* Not suitable volume */
             bnet_fsend(bs, "1998 Volume \"%s\"not appropriate.\n",
@@ -220,6 +221,11 @@ MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.Slot, mr.MediaType);
          bnet_fsend(bs, "1991 Catalog Request failed: %s", db_strerror(jcr->db));
         return;
       }
+      /* Set first written time if this is first job */
+      if (mr.VolJobs == 0) {
+        mr.FirstWritten = jcr->start_time;   /* use Job start time as first write */
+      }
+      Dmsg2(200, "Update media: BefVolJobs=%u After=%u\n", mr.VolJobs, sdmr.VolJobs);
       /* Copy updated values to original media record */
       mr.VolJobs     = sdmr.VolJobs;
       mr.VolFiles    = sdmr.VolFiles;
@@ -262,11 +268,9 @@ MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.Slot, mr.MediaType);
 
       /* Finally, check Use duration expiration */
       } else if (mr.VolUseDuration > 0) {
-        utime_t start;
         utime_t now = time(NULL);
-        start = str_to_utime(mr.cFirstWritten);                         
         /* See if Vol Use has expired */
-        if (start > 0 && mr.VolUseDuration <= (now - start)) {
+        if (mr.VolUseDuration <= (now - mr.FirstWritten)) {
             Jmsg(jcr, M_INFO, 0, _("Max configured use duration exceeded. "       
                "Marking Volume \"%s\"as Used.\n"), mr.VolumeName);
             strcpy(mr.VolStatus, "Used");  /* yes, mark as used */
index 12dd7c5268e62e62d99226c96fc6886bc66c9a73..d9e24f664158d02247b49abb3bca9de1e1e168ec 100644 (file)
@@ -165,7 +165,6 @@ void parse_command_args(UAContext *ua)
         *p++ = 0;                    /* terminate keyword and point to value */
         /* Unquote quoted values */
          if (*p == '"') {
-            Dmsg1(000, "Start with quote: %s\n", p);
             for (n = q = ++p; *p && *p != '"'; ) {
                if (*p == '\\') {
                  p++;
index 81981da13a8fa891c3d275cd87fa25666c240df3..ee06f268e5e09dff4bdf935c5930dab66090c273 100644 (file)
@@ -188,8 +188,10 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr)
    stream = encode_attribsEx(jcr, attribsEx, ff_pkt);
    Dmsg3(200, "File %s\nattribs=%s\nattribsEx=%s\n", ff_pkt->fname, attribs, attribsEx);
      
+   P(jcr->mutex);
    jcr->JobFiles++;                   /* increment number of files sent */
    pm_strcpy(&jcr->last_fname, ff_pkt->fname);
+   V(jcr->mutex);
     
    /*
     * Send Attributes header to Storage daemon
@@ -204,8 +206,8 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr)
    }
    Dmsg1(100, ">stored: attrhdr %s\n", sd->msg);
 
-   /* 
-    * Send file attributes to Storage daemon   
+   /*
+    * Send file attributes to Storage daemon
     *  File_index
     *  File type
     *  Filename (full path)
index be6be79c9579eef169a54c617c8f7dd956706afb..a46f91dde46d0246849adf08cd43cb0b999ef888 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -256,7 +256,9 @@ void do_restore(JCR *jcr)
            break;
         case CF_EXTRACT:
            extract = TRUE;
+           P(jcr->mutex);
            pm_strcpy(&jcr->last_fname, ofile);
+           V(jcr->mutex);
            /* Fall-through wanted */
         case CF_CREATED:
            jcr->JobFiles++;
index a6d7ba446972bb6482572d3381485d8dc4ac7127..dcb52767a1b5e0e1a3ec7ba4e1a738ce398c2935 100755 (executable)
@@ -7,7 +7,7 @@
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -97,7 +97,9 @@ static void do_status(void sendit(char *msg, int len, void *sarg), void *arg)
           edit_uint64_with_commas(njcr->num_files_examined, b1));
       sendit(msg, len, arg);
       if (njcr->JobFiles > 0) {
+         P(njcr->mutex);
          len = Mmsg(&msg, _("    Processing file: %s\n"), njcr->last_fname);
+         V(njcr->mutex);
         sendit(msg, len, arg);
       }
 
index 832c5068064eefe3f4a5a97e60c5e1d5841252b4..231dc7686ea4439182158a943ce1d9ad738985b8 100644 (file)
@@ -150,8 +150,10 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt)
 
    encode_stat(attribs, &ff_pkt->statp);
      
+   P(jcr->mutex);
    jcr->JobFiles++;                 /* increment number of files sent */
    pm_strcpy(&jcr->last_fname, ff_pkt->fname);
+   V(jcr->mutex);
 
 
    /* 
index 36fdff151b3d7c021deecd1beea62f6dd78ead00..45f2eeb6c44d3e0f965713f687c06bc6b6a6e2a1 100644 (file)
@@ -8,7 +8,7 @@
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -159,9 +159,11 @@ void do_verify_volume(JCR *jcr)
         } else {
            *lname = 0;
         }
+        P(jcr->mutex);
         jcr->JobFiles++;
         jcr->num_files_examined++;
         pm_strcpy(&jcr->last_fname, fname); /* last file examined */
+        V(jcr->mutex);
 
         /* 
          * Send file attributes to Director
index d7fc75fb89b332e1b6871a1d50f765447a2b846b..0f3af6176116315131b91b61ce7d5b84034c0ff6 100644 (file)
@@ -31,7 +31,7 @@
 /* Imported functions */
 int find_one_file(FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt), 
               void *pkt, char *p, dev_t parent_device, int top_level);
-void term_find_one(FF_PKT *ff);
+int term_find_one(FF_PKT *ff);
 
 size_t name_max;              /* filename max length */
 size_t path_max;              /* path name max length */
@@ -128,12 +128,14 @@ find_files(FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt)
  * Terminate find_files() and release
  * all allocated memory   
  */
-void
+int
 term_find_files(FF_PKT *ff)
 {
+  int hard_links;
+
   term_include_exclude_files(ff);
   free_pool_memory(ff->sys_fname);
-  term_find_one(ff);
+  hard_links = term_find_one(ff);
   free(ff);
-  return;
+  return hard_links;
 }
index 0b783f0cc25532dd3b60671399642646572961f4..5f2f3468ea04e894170e96eda4072035b5f534b9 100755 (executable)
@@ -152,10 +152,10 @@ find_one_file(FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), void *pkt
          }
 
        /* File not previously dumped. Chain it into our list. */
-       lp = (struct f_link *)bmalloc(sizeof (struct f_link) + strlen(fname));
+       lp = (struct f_link *)bmalloc(sizeof(struct f_link) + strlen(fname) +1);
        lp->ino = ff_pkt->statp.st_ino;
        lp->dev = ff_pkt->statp.st_dev;
-       strcpy (lp->name, fname);
+       strcpy(lp->name, fname);
        lp->next = ff_pkt->linklist;
        ff_pkt->linklist = lp;
    }
@@ -321,9 +321,10 @@ find_one_file(FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), void *pkt
    return handle_file(ff_pkt, pkt);
 }
 
-void term_find_one(FF_PKT *ff)
+int term_find_one(FF_PKT *ff)
 {
    struct f_link *lp, *lc;
+   int count = 0;
   
    /* Free up list of hard linked files */
    for (lp = ff->linklist; lp;) {
@@ -331,7 +332,8 @@ void term_find_one(FF_PKT *ff)
       lp = lp->next;
       if (lc) {
         free(lc);
+        count++;
       }
    }
-   return;
+   return count;
 }
index e2f4960e90bace0eef6b8922a54e7d4cd86a1d7f..e58e9af2ffccdd04a13a642341e19a2429b62176 100644 (file)
@@ -40,7 +40,7 @@ int create_file(void *jcr, char *fname, char *ofile, char *lname,
 FF_PKT *init_find_files();
 void set_find_options(FF_PKT *ff, int incremental, time_t mtime);
 int find_files(FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt), void *pkt);
-void term_find_files(FF_PKT *ff);
+int term_find_files(FF_PKT *ff);
 
 /* From match.c */
 void init_include_exclude_files(FF_PKT *ff);
index f17f1de64cf9af9ce4ef75dd0191b727808310f3..77df8f01c48d18b0ccd649b67a4c514bcc8f2b38 100644 (file)
@@ -56,10 +56,16 @@ utime_t str_to_utime(char *str)
 
    if (sscanf(str, "%d-%d-%d %d:%d:%d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
                                        &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
-      return -1;
+      return 0;
+   }
+   if (tm.tm_mon > 0) {
+      tm.tm_mon--;
+   }
+   if (tm.tm_year >= 1900) {
+      tm.tm_year -= 1900;
+   } else {
+      tm.tm_year = 0;
    }
-   tm.tm_mon--;
-   tm.tm_year -= 1900;
    return (utime_t)mktime(&tm);
 }
 
index d57b4f03b4c91a832576395c7237b73821ef07b7..c9b16f152ed6e89a410b68a4fadd823fc3369928 100644 (file)
@@ -6,7 +6,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -253,7 +253,7 @@ int release_device(JCR *jcr, DEVICE *dev)
         dev->VolCatInfo.VolCatFiles++;             /* increment number of files */
         dev->VolCatInfo.VolCatJobs++;              /* increment number of jobs */
         /* Note! do volume update before close, which zaps VolCatInfo */
-         Dmsg0(100, "dir_update_vol_info. Release\n");
+         Dmsg0(200, "dir_update_vol_info. Release0\n");
         dir_update_volume_info(jcr, &dev->VolCatInfo, 0); /* send Volume info to Director */
 
         if (!dev_is_tape(dev) || !(dev->capabilities & CAP_ALWAYSOPEN)) {
@@ -265,7 +265,7 @@ int release_device(JCR *jcr, DEVICE *dev)
       } else {
          Dmsg0(100, "dir_create_jobmedia_record. Release\n");
         dir_create_jobmedia_record(jcr);
-         Dmsg0(100, "dir_update_vol_info. Release\n");
+         Dmsg0(200, "dir_update_vol_info. Release1\n");
         dev->VolCatInfo.VolCatJobs++;              /* increment number of jobs */
         dir_update_volume_info(jcr, &dev->VolCatInfo, 0); /* send Volume info to Director */
       }
index 64df91039f25f19869e6571e6287a219535f567a..d49ca21df2123bb41d8c179b2a748454685ae0d2 100644 (file)
@@ -7,7 +7,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
index ce3c9234895559606989ca5c4ae3fe3fd0b68e41..7652d6c6f1139f4dc5bc38c8ae0056f5cf54943e 100644 (file)
@@ -533,13 +533,13 @@ reread:
       Dmsg1(000, "%s", dev->errmsg);
       /* Attempt to reposition to re-read the block */
       if (dev->state & ST_TAPE) {
-         Dmsg0(000, "Backspace record for reread.\n");
+         Dmsg0(100, "Backspace record for reread.\n");
         if (bsf_dev(dev, 1) != 0) {
            Emsg0(M_ERROR, 0, dev->errmsg);
            return 0;
         }
       } else {
-         Dmsg0(000, "Seek to beginning of block for reread.\n");
+         Dmsg0(100, "Seek to beginning of block for reread.\n");
         off_t pos = lseek(dev->fd, (off_t)0, SEEK_CUR); /* get curr pos */
         pos -= block->read_len;
         lseek(dev->fd, pos, SEEK_SET);   
index 66894d0596630708777b800b24e194f5bd080e97..e91d8ddf4abcad70fe168ca18f3c7e772ddde284 100644 (file)
@@ -29,7 +29,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -110,7 +110,7 @@ int fixup_device_block_write_error(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
       }
 
       strcpy(dev->VolCatInfo.VolCatStatus, "Full");
-      Dmsg2(100, "Call update_vol_info Stat=%s Vol=%s\n", 
+      Dmsg2(200, "Call update_vol_info Stat=%s Vol=%s\n", 
         dev->VolCatInfo.VolCatStatus, dev->VolCatInfo.VolCatName);
       if (!dir_update_volume_info(jcr, &dev->VolCatInfo, 0)) {   /* send Volume info to Director */
          Jmsg(jcr, M_ERROR, 0, _("Could not update Volume info Volume=%s Job=%s\n"),
index 88de341080095c5692525e2ca3ec6f3f78303478..9402c18de7a6153664a025633feeab1dfe407cef 100644 (file)
@@ -8,7 +8,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -208,6 +208,7 @@ mount_error:
     Setting slot to zero in catalog.\n"),
                  jcr->VolCatInfo.VolCatName, jcr->VolCatInfo.Slot);
               jcr->VolCatInfo.Slot = 0; /* invalidate slot */
+               Dmsg0(200, "update vol info in mount\n");
               dir_update_volume_info(jcr, &jcr->VolCatInfo, 1);  /* set slot */
            }
             Dmsg0(100, "Default\n");
@@ -263,10 +264,10 @@ mount_error:
       /* Recreate a correct volume label and return it in the block */
       write_volume_label_to_block(jcr, dev, block);
       /* Set or reset Volume statistics */
-      dev->VolCatInfo.VolCatJobs = 1;
-      dev->VolCatInfo.VolCatFiles = 1;
+      dev->VolCatInfo.VolCatJobs = 0;
+      dev->VolCatInfo.VolCatFiles = 0;
       dev->VolCatInfo.VolCatErrors = 0;
-      dev->VolCatInfo.VolCatBlocks = 1;
+      dev->VolCatInfo.VolCatBlocks = 0;
       if (recycle) {
         dev->VolCatInfo.VolCatMounts++;  
         dev->VolCatInfo.VolCatRecycles++;
@@ -277,7 +278,7 @@ mount_error:
         dev->VolCatInfo.VolCatReads = 1;
       }
       strcpy(dev->VolCatInfo.VolCatStatus, "Append");
-      Dmsg0(100, "dir_update_vol_info. Set Append\n");
+      Dmsg0(200, "dir_update_vol_info. Set Append\n");
       dir_update_volume_info(jcr, &dev->VolCatInfo, 1);  /* indicate doing relabel */
       if (recycle) {
          Jmsg(jcr, M_INFO, 0, _("Recycled volume %s on device %s, all previous data lost.\n"),
@@ -302,7 +303,7 @@ mount_error:
          Jmsg(jcr, M_INFO, 0, _("Marking Volume %s in Error in Catalog.\n"),
            jcr->VolumeName);
          strcpy(dev->VolCatInfo.VolCatStatus, "Error");
-         Dmsg0(100, "dir_update_vol_info. Set Error.\n");
+         Dmsg0(200, "dir_update_vol_info. Set Error.\n");
         dir_update_volume_info(jcr, &dev->VolCatInfo, 0);
         goto mount_next_vol;
       }
@@ -320,12 +321,13 @@ mount_error:
 The number of files mismatch! Volume=%d Catalog=%d\n"), 
                 dev_file(dev)+1, dev->VolCatInfo.VolCatFiles);
             strcpy(dev->VolCatInfo.VolCatStatus, "Error");
-            Dmsg0(100, "dir_update_vol_info. Set Error.\n");
+            Dmsg0(200, "dir_update_vol_info. Set Error.\n");
            dir_update_volume_info(jcr, &dev->VolCatInfo, 0);
            goto mount_next_vol;
         }
       }
       dev->VolCatInfo.VolCatMounts++;     /* Update mounts */
+      Dmsg1(200, "update volinfo mounts=%d\n", dev->VolCatInfo.VolCatMounts);
       dir_update_volume_info(jcr, &dev->VolCatInfo, 0);
       /* Return an empty block */
       empty_block(block);            /* we used it for reading so set for write */
index c5cf5e7278cbd17823a86f92a76e56b6bf1cd76c..8b0ffa03b9a69ff83930a6413ddc23d915572ea7 100644 (file)
@@ -46,7 +46,7 @@ main (int argc, char *const *argv)
 {
    FF_PKT *ff;
    char name[1000];
-   int i, ch;
+   int i, ch, hard_links;
 
    while ((ch = getopt(argc, argv, "ad:?")) != -1) {
       switch (ch) {
@@ -87,16 +87,17 @@ main (int argc, char *const *argv)
   }
 
   find_files(ff, print_file, NULL);
-  term_find_files(ff);
+  hard_links = term_find_files(ff);
   
    printf(_("\
 Total files    : %d\n\
 Max file length: %d\n\
 Max path length: %d\n\
 Files truncated: %d\n\
-Paths truncated: %d\n"),
+Paths truncated: %d\n\
+Hard links     : %d\n"),
      num_files, max_file_len, max_path_len,
-     trunc_fname, trunc_path);
+     trunc_fname, trunc_path, hard_links);
   
   close_memory_pool();
   sm_dump(False);
index a70ac7728c30922eb73364388c58e32dc0dcf492..a655cc68b559a35c4bbd3957cd5af5c338821daf 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #define VERSION "1.29"
 #define VSTRING "1"
-#define DATE    "9 January 2003"
-#define LSMDATE "09Jan03"
+#define DATE    "12 January 2003"
+#define LSMDATE "12Jan03"
 
 /* Debug flags */
 #define DEBUG 1