Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime,"
"PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus,"
"Type,Level,ClientId,Name,PriorJobId,RealEndTime,JobId,FileSetId,"
-"SchedTime,RealEndTime,ReadBytes,HasBase "
+"SchedTime,RealEndTime,ReadBytes,HasBase,PurgedFiles "
"FROM Job WHERE Job='%s'", jr->Job);
} else {
Mmsg(mdb->cmd, "SELECT VolSessionId,VolSessionTime,"
"PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus,"
"Type,Level,ClientId,Name,PriorJobId,RealEndTime,JobId,FileSetId,"
-"SchedTime,RealEndTime,ReadBytes,HasBase "
+"SchedTime,RealEndTime,ReadBytes,HasBase,PurgedFiles "
"FROM Job WHERE JobId=%s",
edit_int64(jr->JobId, ed1));
}
jr->EndTime = str_to_utime(jr->cEndTime);
jr->RealEndTime = str_to_utime(jr->cRealEndTime);
jr->HasBase = str_to_int64(row[21]);
+ jr->PurgedFiles = str_to_int64(row[22]);
sql_free_result(mdb);
db_unlock(mdb);
"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 WHERE JobId=%s",
+"RealEndTime='%s',PriorJobId=%s,HasBase=%u,PurgedFiles=%u 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,
+ rdt, PriorJobId, jr->HasBase, jr->PurgedFiles,
edit_int64(jr->JobId, ed3));
stat = UPDATE_DB(jcr, mdb, mdb->cmd);
}
}
/* Create Client record if not already there */
- bstrncpy(cr.Name, label.ClientName, sizeof(cr.Name));
- create_client_record(db, &cr);
- jr.ClientId = cr.ClientId;
+ bstrncpy(cr.Name, label.ClientName, sizeof(cr.Name));
+ create_client_record(db, &cr);
+ jr.ClientId = cr.ClientId;
/* process label, if Job record exists don't update db */
mjcr = create_job_record(db, &jr, &label, rec);
jr->JobStatus = elabel->JobStatus;
mjcr->JobStatus = elabel->JobStatus;
jr->JobFiles = elabel->JobFiles;
+ if (jr->JobFiles > 0) { /* If we found files, force PurgedFiles */
+ jr->PurgedFiles = 0;
+ }
jr->JobBytes = elabel->JobBytes;
jr->VolSessionId = rec->VolSessionId;
jr->VolSessionTime = rec->VolSessionTime;