/*
Bacula® - The Network Backup Solution
- Copyright (C) 2002-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2002-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.
/* 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);
/* Forward referenced functions */
static void get_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sessrec);
static DEV_BLOCK *out_block;
static SESSION_LABEL sessrec;
+static CONFIG *config;
#define CONFIG_FILE "bacula-sd.conf"
char *configfile = NULL;
STORES *me = NULL; /* our Global resource */
"\nVersion: %s (%s)\n\n"
"Usage: bcopy [-d debug_level] <input-archive> <output-archive>\n"
" -b bootstrap specify a bootstrap file\n"
-" -c <file> specify configuration file\n"
+" -c <file> specify a Storage configuration file\n"
" -d <nn> set debug level to <nn>\n"
" -dt print timestamp in debug output\n"
" -i specify input Volume names (separated by |)\n"
configfile = bstrdup(CONFIG_FILE);
}
- parse_config(configfile);
+ config = new_config_parser();
+ parse_sd_config(config, configfile, M_ERROR_TERM);
/* Setup and acquire input device for reading */
Dmsg0(100, "About to setup input jcr\n");
Pmsg0(000, _("Volume label not copied.\n"));
return true;
case SOS_LABEL:
- jobs++;
+ if (bsr && rec->match_stat < 1) {
+ /* Skipping record, because does not match BSR filter */
+ if (verbose) {
+ Pmsg0(-1, _("Copy skipped. Record does not match BSR filter.\n"));
+ }
+ } else {
+ jobs++;
+ }
break;
case EOS_LABEL:
+ if (bsr && rec->match_stat < 1) {
+ /* Skipping record, because does not match BSR filter */
+ return true;
+ }
while (!write_record_to_block(out_block, rec)) {
Dmsg2(150, "!write_record_to_block data_len=%d rem=%d\n", rec->data_len,
rec->remainder);
}
/* Write record */
+ if (bsr && rec->match_stat < 1) {
+ /* Skipping record, because does not match BSR filter */
+ return true;
+ }
records++;
while (!write_record_to_block(out_block, rec)) {
Dmsg2(150, "!write_record_to_block data_len=%d rem=%d\n", rec->data_len,
bool dir_send_job_status(JCR *jcr) {return 1;}
-bool dir_ask_sysop_to_mount_volume(DCR *dcr)
+bool dir_ask_sysop_to_mount_volume(DCR *dcr, int /*mode*/)
{
DEVICE *dev = dcr->dev;
fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "),