]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/job.c
Get FD Python running -- design Python backup interface.
[bacula/bacula] / bacula / src / dird / job.c
index bf9a4ea8e40332686f34f61679fb5f44c98c463c..5569fb63582448c8e63e5fe7f5015dd45670f27c 100644 (file)
@@ -93,7 +93,6 @@ JobId_t run_job(JCR *jcr)
    }
    jcr->term_wait_inited = true;
 
-   generate_daemon_event(jcr, "StartJob");
 
    /*
     * Open database
@@ -113,6 +112,7 @@ JobId_t run_job(JCR *jcr)
    }
    Dmsg0(50, "DB opened\n");
 
+
    /*
     * Create Job record
     */
@@ -124,10 +124,11 @@ JobId_t run_job(JCR *jcr)
       goto bail_out;
    }
    JobId = jcr->JobId = jcr->jr.JobId;
-
    Dmsg4(100, "Created job record JobId=%d Name=%s Type=%c Level=%c\n",
        jcr->JobId, jcr->Job, jcr->jr.JobType, jcr->jr.JobLevel);
 
+   generate_daemon_event(jcr, "JobStart");
+
    if (!get_or_create_client_record(jcr)) {
       goto bail_out;
    }
@@ -189,13 +190,13 @@ JobId_t run_job(JCR *jcr)
    return JobId;
 
 bail_out:
+   generate_daemon_event(jcr, "JobEnd");
    if (jcr->fname) {
       free_memory(jcr->fname);
       jcr->fname = NULL;
    }
    V(jcr->mutex);
    return JobId;
-
 }
 
 
@@ -334,7 +335,7 @@ static void *job_thread(void *arg)
 bail_out:
       break;
    }
-
+   generate_daemon_event(jcr, "JobEnd");
    Dmsg1(50, "======== End Job stat=%c ==========\n", jcr->JobStatus);
    sm_check(__FILE__, __LINE__, true);
    return NULL;