]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/restore.c
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / dird / restore.c
index d8b1b72088af86e04609b3c54539bd8e4969064c..6dfb15ef140cd47dcdfc9b08f2a3a2aa2f357a09 100644 (file)
@@ -73,7 +73,7 @@ int do_restore(JCR *jcr)
    }
 
    memset(&rjr, 0, sizeof(rjr));
-   jcr->jr.Level = 'F';            /* Full restore */
+   jcr->jr.Level = L_FULL;        /* Full restore */
    jcr->jr.StartTime = jcr->start_time;
    if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
       Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
@@ -88,6 +88,7 @@ int do_restore(JCR *jcr)
    /* 
     * The following code is kept temporarily for compatibility.
     * It is the predecessor to the Bootstrap file.
+    *  DEPRECATED
     */
    if (!jcr->RestoreBootstrap) {
       /*
@@ -130,7 +131,7 @@ int do_restore(JCR *jcr)
     *
     */
    Dmsg0(10, "Open connection with storage daemon\n");
-   set_jcr_job_status(jcr, JS_Blocked);
+   set_jcr_job_status(jcr, JS_WaitSD);
    /*
     * Start conversation with Storage daemon  
     */
@@ -157,6 +158,7 @@ int do_restore(JCR *jcr)
    /* 
     * Start conversation with File daemon  
     */
+   set_jcr_job_status(jcr, JS_WaitFD);
    if (!connect_to_file_daemon(jcr, 10, FDConnectTimeout, 1)) {
       restore_cleanup(jcr, JS_ErrorTerminated);
       return 0;
@@ -180,7 +182,6 @@ int do_restore(JCR *jcr)
     *  then wait for File daemon to make connection
     *  with Storage daemon.
     */
-   set_jcr_job_status(jcr, JS_Blocked);
    if (jcr->store->SDDport == 0) {
       jcr->store->SDDport = jcr->store->SDport;
    }
@@ -190,7 +191,6 @@ int do_restore(JCR *jcr)
       restore_cleanup(jcr, JS_ErrorTerminated);
       return 0;
    }
-   set_jcr_job_status(jcr, JS_Running);
 
    /* 
     * Send the bootstrap file -- what Volumes/files to restore
@@ -219,6 +219,11 @@ int do_restore(JCR *jcr)
       }
    }
 
+   if (!send_run_before_and_after_commands(jcr)) {
+      restore_cleanup(jcr, JS_ErrorTerminated);
+      return 0;
+   }
+
    /* Send restore command */
    char replace, *where;
 
@@ -236,6 +241,7 @@ int do_restore(JCR *jcr)
    } else {
       where = "";                     /* None */
    }
+   jcr->prefix_links = jcr->job->PrefixLinks;
    bash_spaces(where);
    bnet_fsend(fd, restorecmd, replace, jcr->prefix_links, where);
    unbash_spaces(where);