/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2009 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.
int32_t n = 0;
BSOCK *fd = jcr->file_bsock;
bool fd_ok = false;
- uint32_t JobFiles, Errors;
+ uint32_t JobFiles, JobErrors;
uint64_t ReadBytes = 0;
uint64_t JobBytes = 0;
int VSS = 0;
while ((n = bget_dirmsg(fd)) >= 0) {
if (!fd_ok &&
(sscanf(fd->msg, EndJob, &jcr->FDJobStatus, &JobFiles,
- &ReadBytes, &JobBytes, &Errors, &VSS, &Encrypt) == 7 ||
+ &ReadBytes, &JobBytes, &JobErrors, &VSS, &Encrypt) == 7 ||
sscanf(fd->msg, OldEndJob, &jcr->FDJobStatus, &JobFiles,
- &ReadBytes, &JobBytes, &Errors) == 5)) {
+ &ReadBytes, &JobBytes, &JobErrors) == 5)) {
fd_ok = true;
set_jcr_job_status(jcr, jcr->FDJobStatus);
Dmsg1(100, "FDStatus=%c\n", (char)jcr->JobStatus);
cancel_storage_daemon_job(jcr);
}
- /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/Errors */
+ /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/JobErrors */
wait_for_storage_daemon_termination(jcr);
/* Return values from FD */
if (fd_ok) {
jcr->JobFiles = JobFiles;
- jcr->Errors = Errors;
+ jcr->JobErrors += JobErrors; /* Keep total errors */
jcr->ReadBytes = ReadBytes;
jcr->JobBytes = JobBytes;
jcr->VSS = VSS;
switch (jcr->JobStatus) {
case JS_Terminated:
- if (jcr->Errors || jcr->SDErrors) {
+ if (jcr->JobErrors || jcr->SDErrors) {
term_msg = _("Backup OK -- with warnings");
} else {
term_msg = _("Backup OK");
jcr->VolSessionTime,
edit_uint64_with_commas(mr.VolBytes, ec7),
edit_uint64_with_suffix(mr.VolBytes, ec8),
- jcr->Errors,
+ jcr->JobErrors,
jcr->SDErrors,
fd_term_msg,
sd_term_msg,
jcr->jr.ReadBytes = jcr->ReadBytes;
jcr->jr.VolSessionId = jcr->VolSessionId;
jcr->jr.VolSessionTime = jcr->VolSessionTime;
- jcr->jr.JobErrors = jcr->Errors;
+ jcr->jr.JobErrors = jcr->JobErrors;
if (!db_update_job_end_record(jcr, jcr->db, &jcr->jr)) {
Jmsg(jcr, M_WARNING, 0, _("Error updating job record. %s"),
db_strerror(jcr->db));
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2004-2009 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.
set_jcr_job_status(mig_jcr, JS_Running);
/* Pickup Job termination data */
- /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/Errors */
+ /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/JobErrors */
wait_for_storage_daemon_termination(jcr);
set_jcr_job_status(jcr, jcr->SDJobStatus);
db_write_batch_file_records(jcr); /* used by bulk batch file insert */
switch (jcr->JobStatus) {
case JS_Terminated:
- if (jcr->Errors || jcr->SDErrors) {
+ if (jcr->JobErrors || jcr->SDErrors) {
term_msg = _("%s OK -- with warnings");
} else {
term_msg = _("%s OK");
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2009 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.
edit_uint64_with_commas((uint64_t)jcr->jr.JobFiles, ec2),
edit_uint64_with_commas(jcr->jr.JobBytes, ec3),
(float)kbps,
- jcr->Errors,
+ jcr->JobErrors,
fd_term_msg,
sd_term_msg,
term_msg);
UAContext *ua = (UAContext *)ctx;
POOL_MEM rows(PM_MESSAGE);
+ /* Check for nonsense */
+ if (num_field == 0 || row == NULL || row[0] == NULL) {
+ return 0; /* nothing returned */
+ }
for (int i=0; num_field--; i++) {
if (i == 0) {
pm_strcpy(rows, NPRT(row[0]));
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2008-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2008-2009 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.
set_jcr_job_status(jcr, JS_Running);
/* Pickup Job termination data */
- /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/Errors */
+ /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/JobErrors */
wait_for_storage_daemon_termination(jcr);
set_jcr_job_status(jcr, jcr->SDJobStatus);
db_write_batch_file_records(jcr); /* used by bulk batch file insert */
switch (jcr->JobStatus) {
case JS_Terminated:
- if (jcr->Errors || jcr->SDErrors) {
+ if (jcr->JobErrors || jcr->SDErrors) {
term_msg = _("Backup OK -- with warnings");
} else {
term_msg = _("Backup OK");
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2009 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.
edt,
edit_uint64_with_commas(jcr->ExpectedFiles, ec1),
edit_uint64_with_commas(jcr->JobFiles, ec2),
- jcr->Errors,
+ jcr->JobErrors,
fd_term_msg,
sd_term_msg,
term_msg);
sdt,
edt,
edit_uint64_with_commas(jcr->JobFiles, ec1),
- jcr->Errors,
+ jcr->JobErrors,
fd_term_msg,
term_msg);
}
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2009 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.
berrno be;
Jmsg(jcr, M_NOTSAVED, 0, _(" Could not access \"%s\": ERR=%s\n"), ff_pkt->fname,
be.bstrerror(ff_pkt->ff_errno));
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
case FT_NOFOLLOW: {
berrno be;
Jmsg(jcr, M_NOTSAVED, 0, _(" Could not follow link \"%s\": ERR=%s\n"),
ff_pkt->fname, be.bstrerror(ff_pkt->ff_errno));
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
case FT_NOSTAT: {
berrno be;
Jmsg(jcr, M_NOTSAVED, 0, _(" Could not stat \"%s\": ERR=%s\n"), ff_pkt->fname,
be.bstrerror(ff_pkt->ff_errno));
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
case FT_DIRNOCHG:
berrno be;
Jmsg(jcr, M_NOTSAVED, 0, _(" Could not open directory \"%s\": ERR=%s\n"),
ff_pkt->fname, be.bstrerror(ff_pkt->ff_errno));
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
default:
Jmsg(jcr, M_NOTSAVED, 0, _(" Unknown file type %d; not saved: %s\n"),
ff_pkt->type, ff_pkt->fname);
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
if (signing_digest == NULL) {
Jmsg(jcr, M_NOTSAVED, 0, _("%s signature digest initialization failed\n"),
stream_to_ascii(signing_algorithm));
- jcr->Errors++;
+ jcr->JobErrors++;
goto good_rtn;
}
}
berrno be;
Jmsg(jcr, M_NOTSAVED, 0, _(" Cannot open \"%s\": ERR=%s.\n"), ff_pkt->fname,
be.bstrerror());
- jcr->Errors++;
+ jcr->JobErrors++;
if (tid) {
stop_thread_timer(tid);
tid = NULL;
berrno be;
Jmsg(jcr, M_NOTSAVED, -1, _(" Cannot open resource fork for \"%s\": ERR=%s.\n"),
ff_pkt->fname, be.bstrerror());
- jcr->Errors++;
+ jcr->JobErrors++;
if (is_bopen(&ff_pkt->bfd)) {
bclose(&ff_pkt->bfd);
}
berrno be;
Jmsg(jcr, M_ERROR, 0, _("Read error on file %s. ERR=%s\n"),
ff_pkt->fname, be.bstrerror(ff_pkt->bfd.berrno));
- if (jcr->Errors++ > 1000) { /* insanity check */
+ if (jcr->JobErrors++ > 1000) { /* insanity check */
Jmsg(jcr, M_FATAL, 0, _("Too many errors.\n"));
}
} else if (ff_pkt->flags & FO_ENCRYPT) {
/* Send termination status back to Dir */
dir->fsend(EndJob, jcr->JobStatus, jcr->JobFiles,
edit_uint64(jcr->ReadBytes, ed1),
- edit_uint64(jcr->JobBytes, ed2), jcr->Errors, jcr->VSS,
+ edit_uint64(jcr->JobBytes, ed2), jcr->JobErrors, jcr->VSS,
jcr->crypto.pki_encrypt);
Dmsg1(110, "End FD msg: %s\n", dir->msg);
}
Jmsg(jcr, M_INFO, 0, _("Generate VSS snapshots. Driver=\"%s\", Drive(s)=\"%s\"\n"), g_pVSSClient->GetDriverName(), szWinDriveLetters);
if (!g_pVSSClient->CreateSnapshots(szWinDriveLetters)) {
Jmsg(jcr, M_WARNING, 0, _("Generate VSS snapshots failed.\n"));
- jcr->Errors++;
+ jcr->JobErrors++;
} else {
/* tell user if snapshot creation of a specific drive failed */
int i;
for (i=0; i < (int)strlen(szWinDriveLetters); i++) {
if (islower(szWinDriveLetters[i])) {
Jmsg(jcr, M_WARNING, 0, _("Generate VSS snapshot of drive \"%c:\\\" failed. VSS support is disabled on this drive.\n"), szWinDriveLetters[i]);
- jcr->Errors++;
+ jcr->JobErrors++;
}
}
/* inform user about writer states */
for (i=0; i < (int)g_pVSSClient->GetWriterCount(); i++)
if (g_pVSSClient->GetWriterState(i) < 1) {
Jmsg(jcr, M_WARNING, 0, _("VSS Writer (PrepareForBackup): %s\n"), g_pVSSClient->GetWriterInfo(i));
- jcr->Errors++;
+ jcr->JobErrors++;
}
}
} else {
int msg_type = M_INFO;
if (g_pVSSClient->GetWriterState(i) < 1) {
msg_type = M_WARNING;
- jcr->Errors++;
+ jcr->JobErrors++;
}
Jmsg(jcr, msg_type, 0, _("VSS Writer (BackupComplete): %s\n"), g_pVSSClient->GetWriterInfo(i));
}
bail_out:
- if (jcr->Errors) {
+ if (jcr->JobErrors) {
set_jcr_job_status(jcr, JS_ErrorTerminated);
}
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2001-2009 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.
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2009 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.
berrno be;
be.set_errno(ff_pkt->ff_errno);
Jmsg(jcr, M_NOTSAVED, 1, _(" Could not access %s: ERR=%s\n"), ff_pkt->fname, be.bstrerror());
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
case FT_NOFOLLOW: {
berrno be;
be.set_errno(ff_pkt->ff_errno);
Jmsg(jcr, M_NOTSAVED, 1, _(" Could not follow link %s: ERR=%s\n"), ff_pkt->fname, be.bstrerror());
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
case FT_NOSTAT: {
berrno be;
be.set_errno(ff_pkt->ff_errno);
Jmsg(jcr, M_NOTSAVED, 1, _(" Could not stat %s: ERR=%s\n"), ff_pkt->fname, be.bstrerror());
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
case FT_DIRNOCHG:
berrno be;
be.set_errno(ff_pkt->ff_errno);
Jmsg(jcr, M_NOTSAVED, 1, _(" Could not open directory %s: ERR=%s\n"), ff_pkt->fname, be.bstrerror());
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
default:
Jmsg(jcr, M_NOTSAVED, 0, _(" Unknown file type %d: %s\n"), ff_pkt->type, ff_pkt->fname);
- jcr->Errors++;
+ jcr->JobErrors++;
return 1;
}
size = sizeof(md);
if (digest_file(jcr, ff_pkt, digest) != 0) {
- jcr->Errors++;
+ jcr->JobErrors++;
goto good_rtn;
}
Dmsg2(100, "Error reading file %s: ERR=%s\n", jcr->last_fname, be.bstrerror());
Jmsg(jcr, M_ERROR, 1, _("Error reading file %s: ERR=%s\n"),
jcr->last_fname, be.bstrerror());
- jcr->Errors++;
+ jcr->JobErrors++;
return -1;
}
return 0;
{
int count = 0;
int32_t xattr_list_len,
- xattr_value_len,
- expected_serialize_len = 0;
+ xattr_value_len;
+ uint32_t expected_serialize_len = 0;
char *xattr_list, *bp;
xattr_t *xattr_value_list, *current_xattr;
uint32_t VolSessionId;
uint32_t VolSessionTime;
uint32_t JobFiles; /* Number of files written, this job */
- uint32_t JobErrors; /* */
+ uint32_t JobErrors; /* Number of non-fatal errors this job */
uint64_t JobBytes; /* Number of bytes processed this job */
uint64_t ReadBytes; /* Bytes read -- before compression */
FileId_t FileId; /* Last FileId used */
- uint32_t Errors; /* Number of non-fatal errors */
volatile int32_t JobStatus; /* ready, running, blocked, terminated */
int32_t JobPriority; /* Job priority */
time_t sched_time; /* job schedule time, i.e. when it should start */
num_jobs_run++;
je = (struct s_last_job *)malloc(sizeof(struct s_last_job));
memset(je, 0, sizeof(struct s_last_job)); /* zero in case unset fields */
- je->Errors = jcr->Errors;
+ je->Errors = jcr->JobErrors;
je->JobType = jcr->get_JobType();
je->JobId = jcr->JobId;
je->VolSessionId = jcr->VolSessionId;
case M_ERROR:
len = bsnprintf(rbuf, sizeof(rbuf), _("%s JobId %u: Error: "), my_name, JobId);
if (jcr) {
- jcr->Errors++;
+ jcr->JobErrors++;
}
break;
case M_WARNING:
mixed priorities
General:
+06Mar09
+kes Move src/win32/dll to src/win32/lib, which is much more logical.
+kes Fix the Win32 build.
+kes Fix broken casting in src/compat/print.cpp.
+kes Eliminate jcr Errors and always use jcr JobErrors. This should
+ ensure that SD and FD errors are correctly reported.
28Feb09
mvw Implemented xattr support for Solaris 9 and above and extensible
attributes for OpenSolaris.