]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/restore.c
Correct pool source setting
[bacula/bacula] / bacula / src / dird / restore.c
index 9c0d1573cc916397556290e6f379d99d91877527..90fdb42a63756ad764dc9118199a03da85d77aab 100644 (file)
@@ -18,7 +18,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-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
@@ -43,6 +43,7 @@ static char storaddr[]     = "storage address=%s port=%d ssl=0\n";
 /* Responses received from File daemon */
 static char OKrestore[]   = "2000 OK restore\n";
 static char OKstore[]     = "2000 OK storage\n";
+static char OKbootstrap[] = "2000 OK bootstrap\n";
 
 /*
  * Do a restore of the specified files
@@ -94,10 +95,13 @@ bool do_restore(JCR *jcr)
    /*
     * Now start a job with the Storage daemon
     */
-   if (!start_storage_daemon_job(jcr, jcr->storage, SD_READ)) {
+   if (!start_storage_daemon_job(jcr, jcr->storage, NULL)) {
       restore_cleanup(jcr, JS_ErrorTerminated);
       return false;
    }
+   if (!bnet_fsend(jcr->store_bsock, "run")) {
+      return false;
+   }
    /*
     * Now start a Storage daemon message thread
     */
@@ -107,6 +111,7 @@ bool do_restore(JCR *jcr)
    }
    Dmsg0(50, "Storage daemon connection OK\n");
 
+
    /*
     * Start conversation with File daemon
     */
@@ -119,18 +124,6 @@ bool do_restore(JCR *jcr)
    fd = jcr->file_bsock;
    set_jcr_job_status(jcr, JS_Running);
 
-#ifdef xxx
-   if (!send_include_list(jcr)) {
-      restore_cleanup(jcr, JS_ErrorTerminated);
-      return false;
-   }
-
-   if (!send_exclude_list(jcr)) {
-      restore_cleanup(jcr, JS_ErrorTerminated);
-      return false;
-   }
-#endif
-
    /*
     * send Storage daemon address to the File daemon,
     *   then wait for File daemon to make connection
@@ -149,13 +142,14 @@ bool do_restore(JCR *jcr)
    /*
     * Send the bootstrap file -- what Volumes/files to restore
     */
-   if (!send_bootstrap_file(jcr)) {
+   if (!send_bootstrap_file(jcr, fd) ||
+       !response(jcr, fd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) {
       restore_cleanup(jcr, JS_ErrorTerminated);
       return false;
    }
 
 
-   if (!send_run_before_and_after_commands(jcr)) {
+   if (!send_runscripts_commands(jcr)) {
       restore_cleanup(jcr, JS_ErrorTerminated);
       return false;
    }
@@ -272,7 +266,7 @@ void restore_cleanup(JCR *jcr, int TermCode)
    jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg));
    jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg));
 
-   Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n"
+   Jmsg(jcr, msg_type, 0, _("Bacula %s (%s): %s\n"
 "  JobId:                  %d\n"
 "  Job:                    %s\n"
 "  Client:                 %s\n"
@@ -286,6 +280,8 @@ void restore_cleanup(JCR *jcr, int TermCode)
 "  FD termination status:  %s\n"
 "  SD termination status:  %s\n"
 "  Termination:            %s\n\n"),
+        VERSION,
+        LSMDATE,
         edt,
         jcr->jr.JobId,
         jcr->jr.Job,