struct tm tm;
bool ok;
utime_t JobTDate;
- char ed1[30];
+ char ed1[30],ed2[30];
db_lock(mdb);
/* Must create it */
Mmsg(mdb->cmd,
-"INSERT INTO Job (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate) VALUES "
-"('%s','%s','%c','%c','%c','%s',%s)",
+"INSERT INTO Job (Job,Name,Type,Level,JobStatus,SchedTime,JobTDate,ClientId) "
+"VALUES ('%s','%s','%c','%c','%c','%s',%s,%s)",
jr->Job, jr->Name, (char)(jr->JobType), (char)(jr->JobLevel),
- (char)(jr->JobStatus), dt, edit_uint64(JobTDate, ed1));
+ (char)(jr->JobStatus), dt, edit_uint64(JobTDate, ed1),
+ edit_int64(jr->ClientId, ed2));
if (!INSERT_DB(jcr, mdb, mdb->cmd)) {
Mmsg2(&mdb->errmsg, _("Create DB Job record %s failed. ERR=%s\n"),
* Create Job record
*/
init_jcr_job_record(jcr);
+ if (!get_or_create_client_record(jcr)) {
+ goto bail_out;
+ }
+
if (!db_create_job_record(jcr, jcr->db, &jcr->jr)) {
Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
goto bail_out;
Dmsg4(100, "Created job record JobId=%d Name=%s Type=%c Level=%c\n",
jcr->JobId, jcr->Job, jcr->jr.JobType, jcr->jr.JobLevel);
- if (!get_or_create_client_record(jcr)) {
- goto bail_out;
- }
-
generate_daemon_event(jcr, "JobStart");
if (job_canceled(jcr)) {