]> git.sur5r.net Git - bacula/bacula/commitdiff
Restore all/done updates
authorKern Sibbald <kern@sibbald.com>
Sat, 27 Mar 2004 10:25:21 +0000 (10:25 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 27 Mar 2004 10:25:21 +0000 (10:25 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1155 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ChangeLog
bacula/ReleaseNotes
bacula/src/dird/ua.h
bacula/src/dird/ua_restore.c
bacula/src/dird/ua_tree.c
bacula/src/lib/signal.c

index bad993d5bf2ee3b1b45d6cc01e665aa3ab2af7b4..f7f20a7c054d8b87479480810f8106c9d2bccc2e 100644 (file)
@@ -1,4 +1,16 @@
 
+27Mar04
+- Make the default for restore to have nothing marked.
+- The "all" keyword on the restore command marks everything by
+  default.
+- The "done" keyword on the restore command prevents user interaction
+  with the tree routines -- used mainly for scripting (regression ...).
+- Correct a bug in the last_sibling code.
+- Add alphabetic sorting of siblings so the "dir" and "ls" commands
+  during restore show files in alphabetic order.
+25Mar04
+- Based on Mike Acar's suggestions rework tree insert routines. Improve
+  performance by using a last_sibling link for inserts.
 24Mar04
 - Apply corrected SQL to sql_get.c supplied by Dan Langille.
 - Implement "delete job jobid=xxx jobid=yyy ..."
index f3e20fee7712e4e70ddc5f8b6c795263316e1d47..a644726239fb520084aa3d328e1c23d4d509114c 100644 (file)
@@ -6,11 +6,11 @@
 Major Features:
 - Data spooling which eliminates tape shoe-shine during Inc backups,         
   and permits multiple simultaneous backups without interleaved blocks.
-- Polling of devices eliminating need to unmount and mount from
-  console.
 - Native Win32 client -- much faster and restores permissions correctly
   (thanks to Christopher Hull)
 - PostgreSQL database driver (thanks to Dan Langille).
+- Polling of devices eliminating need to unmount and mount from
+  console.
 - Improved Autochange support of Slots (update slots scan).
 - Autochanger support for multiple drives.
 - New conio code to implement Console command line editing and history.
@@ -20,6 +20,47 @@ Major Features:
 - Daemon statistics memory.
 - Improved btape "test" and "fill" commands.
 
+
+Items to note:  !!!!!
+- The restore default is changed to have nothing selected by default.
+  You must either enter: "restore all" or after getting into the tree
+  selection prompt enter "mark *" to have everything selected.
+- In previous versions the "all" keyword on the restore command caused
+  it to return without user interaction after selecting everything. 
+  This function is now replaced by the "done" keyword (more logical).
+  The "all" keyword now causes everything to be selected by default.
+- The default tape driver behavior is now to write only a single EOF
+  at the end of the tape. For most tape drives, this is totally            
+  transparent and nothing needs to be done. For FreeBSD see below.
+- FreeBSD users NOTE!!!!!
+  You MUST add the following two records to your SD Device resource for
+  tape drives.
+
+     TWOEOF = yes
+     Fast Forward Space File = no
+
+- The daemon protocol has changed, you must update everything at once.
+- The database level has been updated. You must either re-initialize
+  your databases with:
+   
+    ./drop_bacula_tables
+    ./make_bacula_tables
+
+  which will delete ALL prior catalog information, or you can
+  update your database with:
+
+    ./update_bacula_tables
+
+  Please save your old database before dropping the tables or doing
+  an upgrade or you may regret it later.
+
+- smtp has now become bsmtp -- you *must* modify your .conf files.
+- console has now become bconsole.
+- console.conf is now bconsole.conf
+- Please don't underestimate the repercussions of the bsmtp and bconsole 
+  name changes!
+
+
 New directives:
 - "Close on Poll = yes/no" in SD Device resource.
 - "Volume Poll Interval = time-interval" in SD Device resource.
@@ -57,6 +98,9 @@ New Commands:
 - "quit" command in restore tree.
 - Trace option on "setdebug trace=1/0 ..."
 - Update slots scan
+- The "all" keyword on the restore command marks all files by default.
+- The "done" keyword prevents user interaction with the tree -- used
+  mostly for batch scripting.
 
 
 Additional changes:
@@ -133,31 +177,3 @@ Additional changes:
   a single Volume where the volume lable is not in the first 
   tape block, so the tape is not recognized.
 
-Items to note:  !!!!!
-- FreeBSD users NOTE!!!!!
-  You MUST add the following two records to your SD Device resource for
-  tape drives.
-
-     TWOEOF = yes
-     Fast Forward Space File = no
-
-- The daemon protocol has changed, you must update everything at once.
-- The database level has been updated. You must either re-initialize
-  your databases with:
-   
-    ./drop_bacula_tables
-    ./make_bacula_tables
-
-  which will delete ALL prior catalog information, or you can
-  update your database with:
-
-    ./update_bacula_tables
-
-  Please save your old database before dropping the tables or doing
-  an upgrade or you may regret it later.
-
-- smtp has now become bsmtp
-- console has now become bconsole.
-- console.conf is now bconsole.conf
-- Please don't underestimate the repercussions of the bsmtp and bconsole 
-  name changes!
index d2ded609b44d59e11a1e754e5c6811375e75f8db..23fa60377e5f1776ad99db5ff99169112f8343e9 100644 (file)
@@ -58,6 +58,7 @@ struct TREE_CTX {
    TREE_NODE *node;                   /* current node */
    TREE_NODE *avail_node;             /* unused node last insert */
    int cnt;                           /* count for user feedback */
+   bool all;                          /* if set mark all as default */
    UAContext *ua;
 };
 
index a79eb8b0fc039efbf84e110817aaebbd7b37e749..0f20e3a51264fdbab9ba6e01f3b18d3acb5bdf76 100644 (file)
@@ -80,6 +80,7 @@ struct RESTORE_CTX {
    int fnl;                          /* filename length */
    int pnl;                          /* path length */
    bool found;
+   bool all;                         /* mark all as default */
    NAME_LIST name_list;
 };
 
@@ -307,12 +308,13 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       "file",      /* 3 */
       "select",    /* 4 */
       "pool",      /* 5 */
-      "client",    /* 6 */
-      "storage",   /* 7 */
-      "fileset",   /* 8 */
-      "where",     /* 9 */
-      "all",       /* 10 */
+      "all",       /* 6 */
+      "client",    /* 7 */
+      "storage",   /* 8 */
+      "fileset",   /* 9 */
+      "where",     /* 10 */
       "yes",       /* 11 */
+      "done",      /* 12 */
       NULL
    };
 
@@ -387,8 +389,11 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
            return 0;
         }
         break;
+      case 6:                        /* all specified */
+        rx->all = true;
+        break;
       /*     
-       * All keywords 6 or greater are ignored or handled by a select prompt
+       * All keywords 7 or greater are ignored or handled by a select prompt
        */
       default:
         break;
@@ -705,6 +710,7 @@ static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx)
    tree.root = new_tree(rx->TotalFiles);
    tree.root->fname = nofname;
    tree.ua = ua;
+   tree.all = rx->all;
    last_JobId = 0;
    /*
     * For display purposes, the same JobId, with different volumes may
@@ -734,13 +740,13 @@ static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx)
          bsendmsg(ua, "%s", db_strerror(ua->db));
       }
    }
-   bsendmsg(ua, "%d Job%s inserted into the tree and marked for extraction.\n", 
-      items, items==1?"":"s");
+   bsendmsg(ua, "%d Job%s inserted into the tree%s.\n", 
+      items, items==1?"":"s", tree.all?" and marked for extraction":"");
 
    /* Check MediaType and select storage that corresponds */
    get_storage_from_mediatype(ua, &rx->name_list, rx);
 
-   if (find_arg(ua, _("all")) < 0) {
+   if (find_arg(ua, _("done")) < 0) {
       /* Let the user interact in selecting which files to restore */
       OK = user_select_files_from_tree(&tree);
    }
index 7fb06f2a35f1c65bc86bfc829e31ed9d457f7ca6..5ebf41bf25b1051207b2bb4c799ad9b48244d49c 100644 (file)
@@ -193,10 +193,12 @@ int insert_tree_handler(void *ctx, int num_fields, char **row)
       new_node->FileIndex = atoi(row[2]);
       new_node->JobId = (JobId_t)str_to_int64(row[3]);
       new_node->type = type;
-      new_node->extract = true;         /* extract all by default */
       new_node->soft_link = S_ISLNK(statp.st_mode) != 0;
-      if (type == TN_DIR || type == TN_DIR_NLS) {
-        new_node->extract_dir = true;   /* if dir, extract it */
+      if (tree->all) {
+        new_node->extract = true;          /* extract all by default */
+        if (type == TN_DIR || type == TN_DIR_NLS) {
+           new_node->extract_dir = true;   /* if dir, extract it */
+        }
       }
    }
    tree->cnt++;
index aba1640035af4dc0c71c81dd3e666a22fb712007..82027beca48e1d70f12475816b0502f2e8078a8d 100644 (file)
@@ -77,7 +77,7 @@ static void signal_handler(int sig)
    }
    already_dead++;
    if (sig == SIGTERM) {
-      Emsg1(M_TERM, -1, "Shutting down Bacula service: %s ...\n", my_name);
+//    Emsg1(M_TERM, -1, "Shutting down Bacula service: %s ...\n", my_name);
    } else {
       Emsg2(M_FATAL, -1, "Bacula interrupted by signal %d: %s\n", sig, sig_names[sig]);
    }