* Version $Id$
*/
/*
- Copyright (C) 2006 Kern Sibbald
+ Bacula® - The Network Backup Solution
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2 as amended with additional clauses defined in the
- file LICENSE in the main source directory.
+ Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- the file LICENSE for additional details.
+ The main author of Bacula is Kern Sibbald, with contributions from
+ many others, a complete list can be found in the file AUTHORS.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version two of the GNU General Public
+ License as published by the Free Software Foundation plus additions
+ that are listed in the file LICENSE.
- */
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of John Walker.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
#include "bacula.h"
#include "stored.h"
create_restore_volume_list(jcr);
- if (jcr->NumVolumes == 0) {
+ if (jcr->NumReadVolumes == 0) {
Jmsg(jcr, M_FATAL, 0, _("No Volume names found for %s.\n"), Type);
goto bail_out;
}
- Dmsg3(200, "Found %d volumes names for %s. First=%s\n", jcr->NumVolumes,
+ Dmsg3(200, "Found %d volumes names for %s. First=%s\n", jcr->NumReadVolumes,
jcr->VolList->VolumeName, Type);
/* Ready devices for reading and writing */
Dmsg2(200, "===== After acquire pos %u:%u\n", jcr->dcr->dev->file, jcr->dcr->dev->block_num);
-
set_jcr_job_status(jcr, JS_Running);
dir_send_job_status(jcr);
+ begin_data_spool(jcr->dcr);
+ begin_attribute_spool(jcr);
+
jcr->dcr->VolFirstIndex = jcr->dcr->VolLastIndex = 0;
jcr->run_time = time(NULL);
Dmsg2(200, "Flush block to device pos %u:%u\n", dev->file, dev->block_num);
}
+ if (!ok) {
+ discard_data_spool(jcr->dcr);
+ } else {
+ /* Note: if commit is OK, the device will remain locked */
+ commit_data_spool(jcr->dcr);
+ }
if (ok && dev->is_dvd()) {
ok = dvd_close_job(jcr->dcr); /* do DVD cleanup if any */
}
/* Release the device -- and send final Vol info to DIR */
release_device(jcr->dcr);
+
+ if (!ok || job_canceled(jcr)) {
+ discard_attribute_spool(jcr);
+ } else {
+ commit_attribute_spool(jcr);
+ }
}
if (jcr->read_dcr) {
free_restore_volume_list(jcr);
-
- if (!ok || job_canceled(jcr)) {
- discard_attribute_spool(jcr);
- } else {
- commit_attribute_spool(jcr);
- }
-
dir_send_job_status(jcr); /* update director */
edit_uint64(jcr->JobBytes, ec1));
Dmsg4(200, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, ec1);
- bnet_sig(dir, BNET_EOD); /* send EOD to Director daemon */
+ dir->signal(BNET_EOD); /* send EOD to Director daemon */
return ok;
}
crypto_digest_stream_type(stream) != CRYPTO_DIGEST_NONE) {
if (!jcr->no_attributes) {
if (are_attributes_spooled(jcr)) {
- jcr->dir_bsock->spool = true;
+ jcr->dir_bsock->m_spool = true;
}
Dmsg0(850, "Send attributes to dir.\n");
if (!dir_update_file_attributes(jcr->dcr, rec)) {
- jcr->dir_bsock->spool = false;
+ jcr->dir_bsock->m_spool = false;
Jmsg(jcr, M_FATAL, 0, _("Error updating file attributes. ERR=%s\n"),
bnet_strerror(jcr->dir_bsock));
return false;
}
- jcr->dir_bsock->spool = false;
+ jcr->dir_bsock->m_spool = false;
}
}