/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Bacula® is a registered trademark of John Walker.
+ Bacula® is a registered trademark of Kern Sibbald.
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"
+#ifdef USE_VTAPE
+#include "vtape.h"
+#endif
+
/* Dummy functions */
int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
+extern bool parse_sd_config(CONFIG *config, const char *configfile, int exit_code);
/* External subroutines */
extern void free_config_resources();
/* Static variables */
+static CONFIG *config;
#define CONFIG_FILE "bacula-sd.conf"
char *configfile = NULL;
break;
case 'd': /* set debug level */
- debug_level = atoi(optarg);
- if (debug_level <= 0) {
- debug_level = 1;
+ if (*optarg == 't') {
+ dbg_timestamp = true;
+ } else {
+ debug_level = atoi(optarg);
+ if (debug_level <= 0) {
+ debug_level = 1;
+ }
}
break;
daemon_start_time = time(NULL);
- parse_config(configfile);
-
+ config = new_config_parser();
+ parse_sd_config(config, configfile, M_ERROR_TERM);
/* See if we can open a device */
if (margc == 0) {
if (configfile) {
free(configfile);
}
- free_config_resources();
+ if (config) {
+ config->free_resources();
+ free(config);
+ config = NULL;
+ }
if (args) {
free_pool_memory(args);
args = NULL;
Pmsg1(0, _("Begin writing raw blocks of %u bytes.\n"), block->buf_len);
for ( ;; ) {
*p = block_num;
- if (dev->is_tape()) {
- stat = tape_write(dev->fd(), block->buf, block->buf_len);
- } else {
- stat = write(dev->fd(), block->buf, block->buf_len);
- }
+ stat = dev->d_write(dev->fd(), block->buf, block->buf_len);
if (stat == (int)block->buf_len) {
if ((block_num++ % 100) == 0) {
printf("+");
"Usage: btape <options> <device_name>\n"
" -b <file> specify bootstrap file\n"
" -c <file> set configuration file to file\n"
-" -d <nn> set debug level to nn\n"
+" -d <nn> set debug level to <nn>\n"
+" -dt print timestamp in debug output\n"
" -p proceed inspite of I/O errors\n"
" -s turn off signals\n"
" -v be verbose\n"
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
bool dir_send_job_status(JCR *jcr) {return 1;}
-bool dir_update_volume_info(DCR *dcr, bool relabel)
+bool dir_update_volume_info(DCR *dcr, bool relabel, bool update_LastWritten)
{
return 1;
}
return dcr->VolumeName[0] != 0;
}
-bool dir_ask_sysop_to_mount_volume(DCR *dcr)
+bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /* mode */)
{
DEVICE *dev = dcr->dev;
Dmsg0(20, "Enter dir_ask_sysop_to_mount_volume\n");
Pmsg2(000, _("End of Volume \"%s\" %d records.\n"), dcr->VolumeName,
quickie_count);
+ volume_unused(dcr); /* release current volume */
if (LastBlock != block->BlockNumber) {
VolBytes += block->block_len;
}