/*
Bacula(R) - The Network Backup Solution
- Copyright (C) 2000-2015 Kern Sibbald
+ Copyright (C) 2000-2017 Kern Sibbald
The original author of Bacula is Kern Sibbald, with contributions
from many others, a complete list can be found in the file AUTHORS.
bstrncat(name, jcr->client->name(), sizeof(name));
fd->set_source_address(director->DIRsrc_addr);
- if (!fd->connect(jcr,retry_interval,max_retry_time, heart_beat, name, jcr->client->address,
+ if (!fd->connect(jcr,retry_interval,max_retry_time, heart_beat, name, jcr->client->address(),
NULL, jcr->client->FDport, verbose)) {
fd->close();
jcr->setJobStatus(JS_ErrorTerminated);
/* Get the end time of our most recent successfull backup for this job */
/* This will be used to see if there have been any failures since then */
- if (db_find_last_job_end_time(jcr, jcr->db, &jcr->jr, &etime, prev_job)) {
+ if (db_find_last_job_end_time(jcr, jcr->db, &jcr->jr, &etime, prev_job)) {
- /* See if there are any failed Differential/Full backups since the completion */
+ /* See if there are any failed Differential/Full backups since the completion */
/* of our last successful backup for this job */
if (db_find_failed_job_since(jcr, jcr->db, &jcr->jr,
etime, JobLevel)) {
/* If our job is an Incremental and we have a failed job then upgrade. */
/* If our job is a Differential and the failed job is a Full then upgrade. */
/* Otherwise there is no reason to upgrade. */
- if ((jcr->getJobLevel() == L_INCREMENTAL) ||
+ if ((jcr->getJobLevel() == L_INCREMENTAL) ||
((jcr->getJobLevel() == L_DIFFERENTIAL) && (JobLevel == L_FULL))) {
Jmsg(jcr, M_INFO, 0, _("Prior failed job found in catalog. Upgrading to %s.\n"),
level_to_str(JobLevel));
break;
case '<':
p++; /* skip over < */
- if ((ffd = fopen(p, "rb")) == NULL) {
+ if ((ffd = bfopen(p, "rb")) == NULL) {
berrno be;
Jmsg(jcr, M_FATAL, 0, _("Cannot open included file: %s. ERR=%s\n"),
p, be.bstrerror());
return true;
}
+/*
+ *
+ * Send a include list with only one directory and recurse=no
+ * TODO: Need to display the plugin somewhere
+ * The main point is that we don't introduce any protocol change
+ */
+bool send_ls_fileset(JCR *jcr, const char *path)
+{
+ BSOCK *fd = jcr->file_bsock;
+ fd->fsend(filesetcmd, "" /* no vss */, "" /* no snapshot */);
+
+ fd->fsend("I\n");
+ fd->fsend("O h\n"); /* Limit recursion to one directory */
+ fd->fsend("N\n");
+ fd->fsend("F %s\n", path);
+ fd->fsend("N\n");
+ fd->signal(BNET_EOD); /* end of data */
+
+ if (!response(jcr, fd, OKinc, "Include", DISPLAY_ERROR)) {
+ return false;
+ }
+ return true;
+}
+
/*
* Send exclude list to File daemon
* Under the new scheme, the Exclude list