/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2012 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.
POOL_MEM buf;
db_list_ctx jobids;
db_list_ctx nb;
- char ed1[50];
/* In base level, no previous job is used and no restart incomplete jobs */
if (jcr->is_canceled() || jcr->is_JobLevel(L_BASE)) {
return true;
}
- if (!jcr->accurate && !jcr->rerunning) {
+ if (!jcr->accurate) {
return true;
}
if (get_base_jobids(jcr, &jobids)) {
jcr->HasBase = true;
Jmsg(jcr, M_INFO, 0, _("Using BaseJobId(s): %s\n"), jobids.list);
- } else if (!jcr->rerunning) {
+ } else {
return true;
}
} else {
}
}
- /* For incomplete Jobs, we add our own id */
- if (jcr->rerunning) {
- edit_int64(jcr->JobId, ed1);
- jobids.add(ed1);
- }
-
/* Don't send and store the checksum if fileset doesn't require it */
jcr->use_accurate_chksum = is_checksum_needed_by_fileset(jcr);
}
/* Print Job Start message */
- if (jcr->rerunning) {
- Jmsg(jcr, M_INFO, 0, _("Restart Incomplete Backup JobId %s, Job=%s\n"),
- edit_uint64(jcr->JobId, ed1), jcr->Job);
- } else {
- Jmsg(jcr, M_INFO, 0, _("Start Backup JobId %s, Job=%s\n"),
- edit_uint64(jcr->JobId, ed1), jcr->Job);
- }
+ Jmsg(jcr, M_INFO, 0, _("Start Backup JobId %s, Job=%s\n"),
+ edit_uint64(jcr->JobId, ed1), jcr->Job);
jcr->setJobStatus(JS_Running);
Dmsg2(100, "JobId=%d JobLevel=%c\n", jcr->jr.JobId, jcr->jr.JobLevel);
return false;
}
- /* For incomplete Jobs, we add our own id */
- if (jcr->rerunning) {
- edit_int64(jcr->JobId, ed1);
- Mmsg(buf, "SELECT max(FileIndex) FROM File WHERE JobId=%s", ed1);
- if (db_sql_query(jcr->db, buf.c_str(), db_int64_handler, &job)) {
- Jmsg(jcr, M_INFO, 0, _("Found %ld files from prior incomplete Job.\n"),
- (int32_t)job.value);
- } else {
- Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
- return false;
- }
- jcr->JobFiles = job.value;
- Dmsg1(100, "==== FI=%ld\n", jcr->JobFiles);
- Mmsg(buf, "SELECT VolSessionId FROM Job WHERE JobId=%s", ed1);
- if (!db_sql_query(jcr->db, buf.c_str(), db_int64_handler, &job)) {
- Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
- return false;
- }
- jcr->VolSessionId = job.value;
- Mmsg(buf, "SELECT VolSessionTime FROM Job WHERE JobId=%s", ed1);
- if (!db_sql_query(jcr->db, buf.c_str(), db_int64_handler, &job)) {
- Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
- return false;
- }
- jcr->VolSessionTime = job.value;
- Dmsg4(100, "JobId=%s JobFiles=%ld VolSessionId=%ld VolSessionTime=%ld\n", ed1,
- jcr->JobFiles, jcr->VolSessionId, jcr->VolSessionTime);
- }
-
/*
* Open a message channel connection with the Storage
* daemon. This is to let him know that our client
jcr->setJobStatus(JS_Running);
fd = jcr->file_bsock;
- if (!send_include_list(jcr)) {
+ if (!send_level_command(jcr)) {
goto bail_out;
}
- if (!send_exclude_list(jcr)) {
+ if (!send_include_list(jcr)) {
goto bail_out;
}
- if (!send_level_command(jcr)) {
+ if (!send_exclude_list(jcr)) {
goto bail_out;
}
- /* TODO: See priority with bandwidth parameter */
- if (jcr->job->max_bandwidth > 0) {
- jcr->max_bandwidth = jcr->job->max_bandwidth;
- } else if (jcr->client->max_bandwidth > 0) {
- jcr->max_bandwidth = jcr->client->max_bandwidth;
- }
-
- if (jcr->max_bandwidth > 0) {
- send_bwlimit(jcr, jcr->Job); /* Old clients don't have this command */
- }
-
/*
* send Storage daemon address to the File daemon
*/
}
Dmsg2(100, "Enter backup_cleanup %d %c\n", TermCode, TermCode);
- memset(&mr, 0, sizeof(mr));
memset(&cr, 0, sizeof(cr));
#ifdef xxxx
+ /* The current implementation of the JS_Warning status is not
+ * completed. SQL part looks to be ok, but the code is using
+ * JS_Terminated almost everywhere instead of (JS_Terminated || JS_Warning)
+ * as we do with is_canceled()
+ */
if (jcr->getJobStatus() == JS_Terminated &&
(jcr->JobErrors || jcr->SDErrors || jcr->JobWarnings)) {
TermCode = JS_Warnings;