btime_t JobTDate;
int stat;
char ed1[50], ed2[50], ed3[50], ed4[50], ed5[50];
+ char PriorJobId[50];
stime = jr->StartTime;
(void)localtime_r(&stime, &tm);
if (!is_name_valid(jr->LastReadDevice, NULL)) {
*jr->LastReadDevice = 0; // Not valid, not used
}
-
+
+ if (jr->PriorJobId) {
+ bstrncpy(PriorJobId, edit_int64(jr->PriorJobId, ed1), sizeof(PriorJobId));
+ } else {
+ bstrncpy(PriorJobId, "0", sizeof(PriorJobId));
+ }
+
bdb_lock();
Mmsg(cmd, "UPDATE Job SET JobStatus='%c',Level='%c',StartTime='%s',"
"ClientId=%s,JobTDate=%s,PoolId=%s,FileSetId=%s,RealStartTime='%s',"
"isVirtualFull=%d,LastReadStorageId=%d,LastReadDevice='%s',"
- "WriteStorageId=%d,WriteDevice='%s',StatusInfo='%s',Encrypted=%d WHERE JobId=%s",
+ "WriteStorageId=%d,WriteDevice='%s',StatusInfo='%s',Encrypted=%d,PriorJobId=%s,PriorJob='%s' "
+ "WHERE JobId=%s",
(char)(jcr->JobStatus),
(char)(jr->JobLevel), dt,
edit_int64(jr->ClientId, ed1),
jr->WriteDevice,
jr->StatusInfo,
jr->Encrypted,
+ PriorJobId,
+ jr->PriorJob,
edit_int64(jr->JobId, ed5));
stat = UpdateDB(jcr, cmd, false);
int stat;
char ed1[30], ed2[30], ed3[50], ed4[50], ed5[50], ed6[50];
btime_t JobTDate;
- char PriorJobId[50];
-
- if (jr->PriorJobId) {
- bstrncpy(PriorJobId, edit_int64(jr->PriorJobId, ed1), sizeof(PriorJobId));
- } else {
- bstrncpy(PriorJobId, "0", sizeof(PriorJobId));
- }
ttime = jr->EndTime;
(void)localtime_r(&ttime, &tm);
"UPDATE Job SET JobStatus='%c',EndTime='%s',"
"ClientId=%u,JobBytes=%s,ReadBytes=%s,JobFiles=%u,JobErrors=%u,VolSessionId=%u,"
"VolSessionTime=%u,PoolId=%u,FileSetId=%u,JobTDate=%s,"
-"RealEndTime='%s',PriorJobId=%s,HasBase=%u,PurgedFiles=%u,PriorJob='%s',"
+"RealEndTime='%s',HasBase=%u,PurgedFiles=%u,"
"Rate=%.1f,CompressRatio=%.1f,WriteStorageId=%s,LastReadStorageId=%s,StatusInfo='%s',"
"LastReadDevice='%s',WriteDevice='%s',Encrypted=%d WHERE JobId=%s",
(char)(jr->JobStatus), dt, jr->ClientId, edit_uint64(jr->JobBytes, ed1),
edit_uint64(jr->ReadBytes, ed4),
jr->JobFiles, jr->JobErrors, jr->VolSessionId, jr->VolSessionTime,
jr->PoolId, jr->FileSetId, edit_uint64(JobTDate, ed2),
- rdt, PriorJobId, jr->HasBase, jr->PurgedFiles, jr->PriorJob,
+ rdt, jr->HasBase, jr->PurgedFiles,
jr->Rate, jr->CompressRatio, edit_uint64(jr->WriteStorageId, ed5),
edit_uint64(jr->LastReadStorageId, ed6), esc1, esc2, esc3,
jr->Encrypted,
wjcr->jr.JobTDate = wjcr->start_time;
wjcr->setJobStatus(JS_Running);
+ wjcr->jr.PriorJobId = jcr->previous_jr.JobId;
+ if (jcr->previous_jr.PriorJob[0]) {
+ bstrncpy(wjcr->jr.PriorJob, jcr->previous_jr.PriorJob, sizeof(wjcr->jr.PriorJob));
+ } else {
+ bstrncpy(wjcr->jr.PriorJob, jcr->previous_jr.Job, sizeof(wjcr->jr.PriorJob));
+ }
/* Update job start record for the real mac backup job */
if (!db_update_job_start_record(wjcr, wjcr->db, &wjcr->jr)) {
wjcr->JobFiles = jcr->JobFiles = wjcr->SDJobFiles;
wjcr->JobBytes = jcr->JobBytes = wjcr->SDJobBytes;
wjcr->jr.RealEndTime = 0;
- wjcr->jr.PriorJobId = jcr->previous_jr.JobId;
- if (jcr->previous_jr.PriorJob[0]) {
- bstrncpy(wjcr->jr.PriorJob, jcr->previous_jr.PriorJob, sizeof(wjcr->jr.PriorJob));
- } else {
- bstrncpy(wjcr->jr.PriorJob, jcr->previous_jr.Job, sizeof(wjcr->jr.PriorJob));
- }
wjcr->JobErrors += wjcr->SDErrors;
update_job_end(wjcr, TermCode);