"JobErrors, JobMissingFiles, PoolId, FileSetId, PriorJobId, "
"PurgedFiles, HasBase "
"FROM Job "
- "WHERE JobStatus IN ('T', 'f', 'A', 'E') "
+ "WHERE JobStatus IN ('T','W','f','A','E') "
"AND JobId NOT IN (SELECT JobId FROM JobHisto) "
"AND JobTDate < %s ";
" WHERE Client.Name='%s'"
" AND FileSet='%s'"
" AND Client.ClientId=Job.ClientId"
- " AND JobStatus='T' AND Type='B'"
+ " AND JobStatus IN ('T','W') AND Type='B'"
" AND JobMedia.JobId=Job.JobId AND JobMedia.MediaId=Media.MediaId"
" AND Job.FileSetId=FileSet.FileSetId"
" ORDER BY Job.StartTime";
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
"WHERE (Job.JobTDate<%s AND ((DelCandidates.JobFiles=0) OR "
- "(DelCandidates.JobStatus!='T'))) OR "
+ "(DelCandidates.JobStatus NOT IN ('T','W')))) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
- "AND Job.Level='F' AND Job.JobStatus='T' AND Job.Type IN ('B','M') "
+ "AND Job.Level='F' AND Job.JobStatus IN ('T','W') AND Job.Type IN ('B','M') "
"AND Job.FileSetId=DelCandidates.FileSetId)";
/* Select Jobs from the DelCandidates table that have a
const char *select_verify_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
- "AND Job.Type='V' AND Job.Level='V' AND Job.JobStatus='T' "
+ "AND Job.Type='V' AND Job.Level='V' AND Job.JobStatus IN ('T','W') "
"AND Job.FileSetId=DelCandidates.FileSetId)";
const char *select_restore_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
"AND Job.Type='R')";
const char *select_admin_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
"AND Job.Type='D')";
const char *select_migrate_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
"AND Job.Type='g')";
const char *select_copy_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobTdate<%s AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
"AND Job.Type='C')";
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
"WHERE (Job.JobId=DelCandidates.JobId AND ((DelCandidates.JobFiles=0) OR "
- "(DelCandidates.JobStatus!='T'))) OR "
+ "(DelCandidates.JobStatus NOT IN ('T','W')))) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
- "AND Job.Level='F' AND Job.JobStatus='T' AND Job.Type IN ('B','M') "
+ "AND Job.Level='F' AND Job.JobStatus IN ('T','W') AND Job.Type IN ('B','M') "
"AND Job.FileSetId=DelCandidates.FileSetId)";
/* Select Jobs from the DelCandidates table that have a
const char *select_verify_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
- "AND Job.Type='V' AND Job.Level='V' AND Job.JobStatus='T' "
+ "AND Job.Type='V' AND Job.Level='V' AND Job.JobStatus IN ('T','W') "
"AND Job.FileSetId=DelCandidates.FileSetId)";
const char *select_restore_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
"AND Job.Type='R')";
const char *select_admin_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
"AND Job.Type='D')";
const char *select_migrate_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
"AND Job.Type='g')";
const char *select_copy_del =
"SELECT DISTINCT DelCandidates.JobId,DelCandidates.PurgedFiles "
"FROM Job,DelCandidates "
- "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus!='T') OR "
+ "WHERE (Job.JobId=DelCandidates.JobId AND DelCandidates.JobStatus NOT IN ('T','W')) OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%s "
"AND Job.Type='C')";
const char *uar_list_jobs =
"SELECT JobId,Client.Name as Client,StartTime,Level as "
"JobLevel,JobFiles,JobBytes "
- "FROM Client,Job WHERE Client.ClientId=Job.ClientId AND JobStatus='T' "
+ "FROM Client,Job WHERE Client.ClientId=Job.ClientId AND JobStatus IN ('T','W') "
"AND Type='B' ORDER BY StartTime DESC LIMIT 20";
/*
"FROM Client,Job,JobMedia,Media,FileSet WHERE Client.ClientId=%s "
"AND Job.ClientId=%s "
"AND Job.StartTime<'%s' "
- "AND Level='F' AND JobStatus='T' AND Type='B' "
+ "AND Level='F' AND JobStatus IN ('T','W') AND Type='B' "
"AND JobMedia.JobId=Job.JobId "
"AND Media.Enabled=1 "
"AND JobMedia.MediaId=Media.MediaId "
"Job.ClientId,Job.Level,Job.JobFiles,Job.JobBytes,"
"StartTime,VolumeName,JobMedia.StartFile,VolSessionId,VolSessionTime "
"FROM temp1,Job,JobMedia,Media WHERE temp1.JobId=Job.JobId "
- "AND Level='F' AND JobStatus='T' AND Type='B' "
+ "AND Level='F' AND JobStatus IN ('T','W') AND Type='B' "
"AND Media.Enabled=1 "
"AND JobMedia.JobId=Job.JobId "
"AND JobMedia.MediaId=Media.MediaId";
"AND JobMedia.JobId=Job.JobId "
"AND Media.Enabled=1 "
"AND JobMedia.MediaId=Media.MediaId "
- "AND Job.Level='D' AND JobStatus='T' AND Type='B' "
+ "AND Job.Level='D' AND JobStatus IN ('T','W') AND Type='B' "
"AND Job.FileSetId=FileSet.FileSetId "
"AND FileSet.FileSet='%s' "
"%s"
"AND Media.Enabled=1 "
"AND JobMedia.JobId=Job.JobId "
"AND JobMedia.MediaId=Media.MediaId "
- "AND Job.Level='I' AND JobStatus='T' AND Type='B' "
+ "AND Job.Level='I' AND JobStatus IN ('T','W') AND Type='B' "
"AND Job.FileSetId=FileSet.FileSetId "
"AND FileSet.FileSet='%s' "
"%s";
if (jr->JobId == 0) {
/* Differential is since last Full backup */
Mmsg(mdb->cmd,
-"SELECT StartTime FROM Job WHERE JobStatus='T' AND Type='%c' AND "
+"SELECT StartTime FROM Job WHERE JobStatus IN ('T','W') AND Type='%c' AND "
"Level='%c' AND Name='%s' AND ClientId=%s AND FileSetId=%s "
"ORDER BY StartTime DESC LIMIT 1",
jr->JobType, L_FULL, jr->Name,
sql_free_result(mdb);
/* Now edit SQL command for Incremental Job */
Mmsg(mdb->cmd,
-"SELECT StartTime FROM Job WHERE JobStatus='T' AND Type='%c' AND "
+"SELECT StartTime FROM Job WHERE JobStatus IN ('T','W') AND Type='%c' AND "
"Level IN ('%c','%c','%c') AND Name='%s' AND ClientId=%s "
"AND FileSetId=%s ORDER BY StartTime DESC LIMIT 1",
jr->JobType, L_INCREMENTAL, L_DIFFERENTIAL, L_FULL, jr->Name,
pm_strcpy(stime, "0000-00-00 00:00:00"); /* default */
Mmsg(mdb->cmd,
-"SELECT StartTime FROM Job WHERE JobStatus='T' AND Type='%c' AND "
+"SELECT StartTime FROM Job WHERE JobStatus IN ('T','W') AND Type='%c' AND "
"Level='%c' AND Name='%s' AND ClientId=%s AND FileSetId=%s "
"ORDER BY StartTime DESC LIMIT 1",
jr->JobType, JobLevel, jr->Name,
if (jr->JobLevel == L_VERIFY_CATALOG) {
Mmsg(mdb->cmd,
"SELECT JobId FROM Job WHERE Type='V' AND Level='%c' AND "
-" JobStatus='T' AND Name='%s' AND "
+" JobStatus IN ('T','W') AND Name='%s' AND "
"ClientId=%s ORDER BY StartTime DESC LIMIT 1",
L_VERIFY_INIT, jr->Name,
edit_int64(jr->ClientId, ed1));
jr->JobType == JT_BACKUP) {
if (Name) {
Mmsg(mdb->cmd,
-"SELECT JobId FROM Job WHERE Type='B' AND JobStatus='T' AND "
+"SELECT JobId FROM Job WHERE Type='B' AND JobStatus IN ('T','W') AND "
"Name='%s' ORDER BY StartTime DESC LIMIT 1", Name);
} else {
Mmsg(mdb->cmd,
-"SELECT JobId FROM Job WHERE Type='B' AND JobStatus='T' AND "
+"SELECT JobId FROM Job WHERE Type='B' AND JobStatus IN ('T','W') AND "
"ClientId=%s ORDER BY StartTime DESC LIMIT 1",
edit_int64(jr->ClientId, ed1));
}
/* Find next available volume */
if (InChanger) {
Mmsg(changer, "AND InChanger=1 AND StorageId=%s",
- edit_int64(mr->StorageId, ed1));
+ edit_int64(mr->StorageId, ed1));
}
if (strcmp(mr->VolStatus, "Recycle") == 0 ||
strcmp(mr->VolStatus, "Purged") == 0) {
Mmsg(mdb->cmd,
"SELECT FileId, LStat, MD5 FROM File,Job WHERE "
"File.JobId=Job.JobId AND File.PathId=%s AND "
-"File.FilenameId=%s AND Job.Type='B' AND Job.JobStatus='T' AND "
+"File.FilenameId=%s AND Job.Type='B' AND Job.JobStatus IN ('T','W') AND "
"ClientId=%s ORDER BY StartTime DESC LIMIT 1",
edit_int64(fdbr->PathId, ed1),
edit_int64(fdbr->FilenameId, ed2),
"SELECT JobId, StartTime, EndTime, JobTDate, PurgedFiles "
"FROM Job JOIN FileSet USING (FileSetId) "
"WHERE ClientId = %s "
- "AND Level='F' AND JobStatus='T' AND Type='B' "
+ "AND Level='F' AND JobStatus IN ('T','W') AND Type='B' "
"AND StartTime<'%s' "
"AND FileSet.FileSet=(SELECT FileSet FROM FileSet WHERE FileSetId = %s) "
"ORDER BY Job.JobTDate DESC LIMIT 1",
"SELECT JobId, StartTime, EndTime, JobTDate, PurgedFiles "
"FROM Job JOIN FileSet USING (FileSetId) "
"WHERE ClientId = %s "
- "AND Level='D' AND JobStatus='T' AND Type='B' "
+ "AND Level='D' AND JobStatus IN ('T','W') AND Type='B' "
"AND StartTime > (SELECT EndTime FROM btemp3%s ORDER BY EndTime DESC LIMIT 1) "
"AND FileSet.FileSet= (SELECT FileSet FROM FileSet WHERE FileSetId = %s) "
"ORDER BY Job.JobTDate DESC LIMIT 1 ",
"SELECT JobId, StartTime, EndTime, JobTDate, PurgedFiles "
"FROM Job JOIN FileSet USING (FileSetId) "
"WHERE ClientId = %s "
- "AND Level='I' AND JobStatus='T' AND Type='B' "
+ "AND Level='I' AND JobStatus IN ('T','W') AND Type='B' "
"AND StartTime > (SELECT EndTime FROM btemp3%s ORDER BY EndTime DESC LIMIT 1) "
"AND FileSet.FileSet= (SELECT FileSet FROM FileSet WHERE FileSetId = %s) "
"ORDER BY Job.JobTDate DESC ",
/*
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.
BSOCK *fd = jcr->file_bsock;
bool fd_ok = false;
uint32_t JobFiles, JobErrors;
+ uint32_t JobWarnings = 0;
uint64_t ReadBytes = 0;
uint64_t JobBytes = 0;
int VSS = 0;
jcr->JobErrors += JobErrors; /* Keep total errors */
jcr->ReadBytes = ReadBytes;
jcr->JobBytes = JobBytes;
+ jcr->JobWarnings = JobWarnings;
jcr->VSS = VSS;
jcr->Encrypt = Encrypt;
} else {
term_msg = _("Backup OK");
}
break;
+ case JS_Warnings:
+ term_msg = _("Backup OK -- with warnings");
+ break;
case JS_FatalError:
case JS_ErrorTerminated:
term_msg = _("*** Backup Error ***");
/*
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.
}
/* TODO: redirect command ouput to job log */
-bool run_console_command(JCR *jcr, const char *cmd){
+bool run_console_command(JCR *jcr, const char *cmd)
+{
UAContext *ua;
bool ok;
JCR *ljcr = new_control_jcr("-RunScript-", JT_CONSOLE);
"SELECT DISTINCT Job.JobId,Job.StartTime FROM Job,Pool,Client"
" WHERE Client.Name='%s' AND Pool.Name='%s' AND Job.PoolId=Pool.PoolId"
" AND Job.ClientId=Client.ClientId AND Job.Type='B'"
- " AND Job.JobStatus = 'T'"
+ " AND Job.JobStatus IN ('T','W')"
" ORDER by Job.StartTime";
/* Get Volume names in Pool */
"SELECT DISTINCT Job.JobId,Job.StartTime FROM Media,JobMedia,Job"
" WHERE Media.VolumeName='%s' AND Media.MediaId=JobMedia.MediaId"
" AND JobMedia.JobId=Job.JobId AND Job.Type='B'"
- " AND Job.JobStatus = 'T' AND Media.Enabled=1"
+ " AND Job.JobStatus IN ('T','W') AND Media.Enabled=1"
" ORDER by Job.StartTime";
const char *sql_smallest_vol =
const char *sql_jobids_from_mediaid =
"SELECT DISTINCT Job.JobId,Job.StartTime FROM JobMedia,Job"
" WHERE JobMedia.JobId=Job.JobId AND JobMedia.MediaId IN (%s)"
- " AND Job.Type='B' AND Job.JobStatus = 'T'"
+ " AND Job.Type='B' AND Job.JobStatus IN ('T','W')"
" ORDER by Job.StartTime";
/* Get the number of bytes in the pool */
" (SELECT DISTINCT Job.JobId from Pool,Job,Media,JobMedia WHERE"
" Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND"
" VolStatus in ('Full','Used','Error','Append') AND Media.Enabled=1 AND"
- " Job.Type='B' AND Job.JobStatus = 'T' AND"
+ " Job.Type='B' AND Job.JobStatus IN ('T','W') AND"
" JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId)";
/* Get the number of bytes in the Jobs */
const char *sql_pool_time =
"SELECT DISTINCT Job.JobId FROM Pool,Job,Media,JobMedia WHERE"
" Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND"
- " VolStatus in ('Full','Used','Error') AND Media.Enabled=1 AND"
- " Job.Type='B' AND Job.JobStatus = 'T' AND"
+ " VolStatus IN ('Full','Used','Error') AND Media.Enabled=1 AND"
+ " Job.Type='B' AND Job.JobStatus IN ('T','W') AND"
" JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId"
" AND Job.RealEndTime<='%s'";
const char *sql_jobids_of_pool_uncopied_jobs =
"SELECT DISTINCT Job.JobId,Job.StartTime FROM Job,Pool"
" WHERE Pool.Name = '%s' AND Pool.PoolId = Job.PoolId"
- " AND Job.Type = 'B' AND Job.JobStatus = 'T'"
+ " AND Job.Type = 'B' AND Job.JobStatus IN ('T','W')"
" AND Job.jobBytes > 0"
" AND Job.JobId NOT IN"
" (SELECT PriorJobId FROM Job WHERE"
- " Type IN ('B','C') AND Job.JobStatus = 'T'"
+ " Type IN ('B','C') AND Job.JobStatus IN ('T','W')"
" AND PriorJobId != 0)"
" ORDER by Job.StartTime";
term_msg = _("Restore OK");
}
break;
+ case JS_Warnings:
+ term_msg = _("Restore OK -- with warnings");
+ break;
case JS_FatalError:
case JS_ErrorTerminated:
term_msg = _("*** Restore Error ***");
/*
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.
status = 2 ; /* Critical */
break;
+ case JS_Warnings:
case JS_Terminated:
status = 0 ; /* Ok */
break;
/*
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.
/* List JOBMEDIA */
} else if (strcasecmp(ua->argk[i], NT_("jobmedia")) == 0) {
- int done = FALSE;
+ bool done = false;
for (j=i+1; j<ua->argc; j++) {
if (strcasecmp(ua->argk[j], NT_("ujobid")) == 0 && ua->argv[j]) {
bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
continue;
}
db_list_jobmedia_records(ua->jcr, ua->db, jobid, prtit, ua, llist);
- done = TRUE;
+ done = true;
}
if (!done) {
/* List for all jobs (jobid=0) */
/* List JOBLOG */
} else if (strcasecmp(ua->argk[i], NT_("joblog")) == 0) {
- int done = FALSE;
+ bool done = false;
for (j=i+1; j<ua->argc; j++) {
if (strcasecmp(ua->argk[j], NT_("ujobid")) == 0 && ua->argv[j]) {
bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH);
continue;
}
db_list_joblog_records(ua->jcr, ua->db, jobid, prtit, ua, llist);
- done = TRUE;
+ done = true;
}
if (!done) {
/* List for all jobs (jobid=0) */
case JS_Terminated:
msg = _("has terminated");
break;
+ case JS_Warnings:
+ msg = _("has terminated with warnings");
+ break;
case JS_ErrorTerminated:
msg = _("has erred");
break;
case JS_Terminated:
termstat = _("OK");
break;
+ case JS_Warnings:
+ termstat = _("OK -- with warnings");
+ break;
default:
termstat = _("Other");
break;
db_strerror(jcr->db));
return false;
}
- if (jcr->previous_jr.JobStatus != 'T') {
+ if (!(jcr->previous_jr.JobStatus == JS_Terminated ||
+ jcr->previous_jr.JobStatus == JS_Warnings)) {
Jmsg(jcr, M_FATAL, 0, _("Last Job %d did not terminate normally. JobStatus=%c\n"),
verify_jobid, jcr->previous_jr.JobStatus);
return false;
Dmsg0(110, "Error in blast_data.\n");
} else {
set_jcr_job_status(jcr, JS_Terminated);
-
- if (jcr->JobStatus != JS_Terminated) {
+ /* Note, the above set status will not override an error */
+ if (!(jcr->JobStatus == JS_Terminated || jcr->JobStatus == JS_Warnings)) {
bnet_suppress_error_messages(sd, 1);
goto cleanup; /* bail out now */
}
Jmsg(jcr, M_FATAL, 0, _("Append Close with SD failed.\n"));
goto cleanup;
}
- if (SDJobStatus != JS_Terminated) {
+ if (!(SDJobStatus == JS_Terminated || SDJobStatus == JS_Warnings)) {
Jmsg(jcr, M_FATAL, 0, _("Bad status %d returned from Storage Daemon.\n"),
SDJobStatus);
}
/*
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.
#define JS_Running 'R' /* running */
#define JS_Blocked 'B' /* blocked */
#define JS_Terminated 'T' /* terminated normally */
+#define JS_Warnings 'W' /* Terminated normally with warnings */
#define JS_ErrorTerminated 'E' /* Job terminated in error */
#define JS_Error 'e' /* Non-fatal error */
#define JS_FatalError 'f' /* Fatal error */
uint32_t VolSessionTime;
uint32_t JobFiles; /* Number of files written, this job */
uint32_t JobErrors; /* Number of non-fatal errors this job */
+ uint32_t JobWarnings; /* Number of warning messages */
uint64_t JobBytes; /* Number of bytes processed this job */
uint64_t ReadBytes; /* Bytes read -- before compression */
FileId_t FileId; /* Last FileId used */
}
if (
(d->dest_code == MD_MAIL_ON_ERROR && jcr &&
- jcr->JobStatus == JS_Terminated)
+ (jcr->JobStatus == JS_Terminated || jcr->JobStatus == JS_Warnings))
||
(d->dest_code == MD_MAIL_ON_SUCCESS && jcr &&
jcr->JobStatus == JS_ErrorTerminated)
- ){
+ ) {
goto rem_temp_file;
}
break;
case M_WARNING:
len = bsnprintf(rbuf, sizeof(rbuf), _("%s JobId %u: Warning: "), my_name, JobId);
+ if (jcr) {
+ jcr->JobWarnings++;
+ }
break;
case M_SECURITY:
len = bsnprintf(rbuf, sizeof(rbuf), _("%s JobId %u: Security violation: "),
}
if ((script->when & SCRIPT_After) && (when & SCRIPT_After)) {
- if ((script->on_success && (jcr->JobStatus == JS_Terminated))
+ if ((script->on_success &&
+ (jcr->JobStatus == JS_Terminated || jcr->JobStatus == JS_Warnings))
|| (script->on_failure && job_canceled(jcr))
)
{
/*
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.
case JS_Error:
jobstat = _("Non-fatal error");
break;
+ case JS_Warnings:
+ jobstat = _("OK -- with warnings");
+ break;
case JS_Canceled:
jobstat = _("Canceled");
break;
case JS_Terminated:
cnv = _("Completed successfully");
break;
+ case JS_Warnings:
+ cnv = _("Completed with warnings");
+ break;
case JS_ErrorTerminated:
cnv = _("Terminated with errors");
break;
if (cnv) {
bstrncpy(msg, cnv, maxlen);
} else {
- jobstatus_to_ascii( JobStatus, msg, maxlen);
+ jobstatus_to_ascii(JobStatus, msg, maxlen);
}
}
case JS_Terminated:
str = _("OK");
break;
+ case JS_Warnings:
+ str = _("OK -- with warnings");
+ break;
case JS_ErrorTerminated:
case JS_Error:
str = _("Error");
case JS_Terminated:
term_msg = _("Backup OK");
break;
+ case JS_Warnings:
+ term_msg = _("Backup OK -- with warnings");
+ break;
case JS_FatalError:
case JS_ErrorTerminated:
term_msg = _("*** Backup Error ***");
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2003-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2003-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.
case JS_Terminated:
termstat = _("OK");
break;
+ case JS_Warnings:
+ termstat = _("OK -- with warnings");
+ break;
default:
termstat = _("Other");
break;
mixed priorities
General:
+07Mar09
+kes Prepare to add JS_Warnings termination status.
+kes Attempt to resolve bwx-console Win32 crash. Not likely to
+ work.
06Mar09
kes Move src/win32/dll to src/win32/lib, which is much more logical.
kes Fix the Win32 build.