]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl fix runscript : they was run before the real end of job
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 12 Feb 2007 19:52:58 +0000 (19:52 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 12 Feb 2007 19:52:58 +0000 (19:52 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4172 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/job.c

index 50ca4cf320a02fd7e0ad55085a65e1bd7a85034b..5c8d4c55c1889578882f431c6a0d8641ba567139 100644 (file)
@@ -244,16 +244,14 @@ void *handle_client_request(void *dirp)
       }
    }
 
-   if (!jcr->runscript_after) {
-      jcr->runscript_after=1;
-      run_scripts(jcr, jcr->RunScripts, "ClientAfterJob");
-   }
-
    /* Inform Storage daemon that we are done */
    if (jcr->store_bsock) {
       bnet_sig(jcr->store_bsock, BNET_TERMINATE);
    }
 
+   /* run after job */   
+   run_scripts(jcr, jcr->RunScripts, "ClientAfterJob");
+
    generate_daemon_event(jcr, "JobEnd");
 
    dequeue_messages(jcr);             /* send any queued messages */
@@ -1389,17 +1387,9 @@ static int backup_cmd(JCR *jcr)
       bnet_suppress_error_messages(sd, 1);
       bget_msg(sd);                   /* Read final response from append_data */
       Dmsg0(110, "Error in blast_data.\n");
-      /* run shortly after end of data transmission */ 
-      run_scripts(jcr, jcr->RunScripts, "ClientAfterJob");
-      jcr->runscript_after=1;
-
    } else {
       set_jcr_job_status(jcr, JS_Terminated);
 
-      /* run shortly after end of data transmission */   
-      run_scripts(jcr, jcr->RunScripts, "ClientAfterJob");
-      jcr->runscript_after=1;
-
       if (jcr->JobStatus != JS_Terminated) {
          bnet_suppress_error_messages(sd, 1);
          goto cleanup;                /* bail out now */