* 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
/* 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
BSOCK *fd;
JOB_DBR rjr; /* restore job record */
+ free_wstorage(jcr); /* we don't write */
+
memset(&rjr, 0, sizeof(rjr));
jcr->jr.JobLevel = L_FULL; /* Full restore */
if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
/*
* 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->rstorage, NULL)) {
restore_cleanup(jcr, JS_ErrorTerminated);
return false;
}
+ if (!bnet_fsend(jcr->store_bsock, "run")) {
+ return false;
+ }
/*
* Now start a Storage daemon message thread
*/
}
Dmsg0(50, "Storage daemon connection OK\n");
+
/*
* Start conversation with File daemon
*/
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
* with Storage daemon.
*/
- if (jcr->store->SDDport == 0) {
- jcr->store->SDDport = jcr->store->SDport;
+ if (jcr->rstore->SDDport == 0) {
+ jcr->rstore->SDDport = jcr->rstore->SDport;
}
- bnet_fsend(fd, storaddr, jcr->store->address, jcr->store->SDDport);
+ bnet_fsend(fd, storaddr, jcr->rstore->address, jcr->rstore->SDDport);
Dmsg1(6, "dird>filed: %s\n", fd->msg);
if (!response(jcr, fd, OKstore, "Storage", DISPLAY_ERROR)) {
restore_cleanup(jcr, JS_ErrorTerminated);
/*
* 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;
}
bool do_restore_init(JCR *jcr)
{
+ free_wstorage(jcr);
return true;
}