]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Rename runscript runswhen from JobEnd to AtJobCompletion
authorEric Bollengier <eric@baculasystems.com>
Mon, 7 Feb 2022 09:50:11 +0000 (10:50 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:57 +0000 (13:56 +0200)
bacula/src/dird/admin.c
bacula/src/dird/backup.c
bacula/src/dird/dird_conf.c
bacula/src/dird/fd_cmds.c
bacula/src/dird/mac.c
bacula/src/dird/restore.c
bacula/src/dird/vbackup.c
bacula/src/dird/verify.c
bacula/src/lib/runscript.c
bacula/src/lib/runscript.h

index 708fda262cf321d6424bfaf65e6a61351c4f13ed..9a853f53fb788e9587a4c27aefad548184c3e193 100644 (file)
@@ -80,7 +80,7 @@ void admin_cleanup(JCR *jcr, int TermCode)
    /* Job needs to be marked as terminated before running the after runscript */
    jcr->setJobStatus(TermCode);
 
-   run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+   run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
 
    /* Runscript could have changed JobStatus,
     * now check if it should be changed in the report or not */
index 1f232430bde2c764ddc9a7ee48bf87423a94949e..dc82c8847b4663ceb140785c13feb02e028cc613 100644 (file)
@@ -994,7 +994,7 @@ void backup_cleanup(JCR *jcr, int TermCode)
    /* Job needs to be marked as terminated before running the after runscript */
    jcr->setJobStatus(TermCode);
 
-   run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+   run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
 
    /* Runscript could have changed JobStatus,
     * now check if it should be changed in the report or not */
index 783a035ac4508778fd93aef5f6f91c3c4d9f5c2d..39d0931955864ad303406c23623f657bf8f1a32a 100644 (file)
@@ -2481,12 +2481,12 @@ static void store_runscript_when(LEX *lc, RES_ITEM *item, int index, int pass)
       *(uint32_t *)(item->value) = SCRIPT_AfterVSS;
    } else if (strcasecmp(lc->str, "aftersnapshot") == 0) {
       *(uint32_t *)(item->value) = SCRIPT_AfterVSS;
-   } else if (strcasecmp(lc->str, "endjob") == 0) {
-      *(uint32_t *)(item->value) = SCRIPT_EndJob;
+   } else if (strcasecmp(lc->str, "atjobcompletion") == 0) {
+      *(uint32_t *)(item->value) = SCRIPT_AtJobCompletion;
    } else if (strcasecmp(lc->str, "always") == 0) {
       *(uint32_t *)(item->value) = SCRIPT_Any;
    } else {
-      scan_err2(lc, _("Expect %s, got: %s"), "Before, EndJob, After, AfterVSS or Always", lc->str);
+      scan_err2(lc, _("Expect %s, got: %s"), "Before, AtJobCompletion, After, AfterVSS or Always", lc->str);
    }
    scan_to_eol(lc);
 }
index 64738597e7c3c1b1bdddf9e2770a809d0b61ddcd..db07ae9f6dda043d0a933e71b363d63ff6d0752c 100644 (file)
@@ -832,8 +832,8 @@ int send_runscripts_commands(JCR *jcr)
                result = send_runscript_with_old_proto(jcr, cmd->when, msg);
 
             } else {
-               /* On the FileDaemon, EndJob is a synonym of After */
-               cmd->when = (cmd->when == SCRIPT_EndJob) ? SCRIPT_After : cmd->when;
+               /* On the FileDaemon, AtJobCompletion is a synonym of After */
+               cmd->when = (cmd->when == SCRIPT_AtJobCompletion) ? SCRIPT_After : cmd->when;
                fd->fsend(runscript, cmd->on_success,
                                     cmd->on_failure,
                                     cmd->fail_on_error,
index aead3e5686a43249f990c2c933064ab5636a3151..fc588b8e1ef334289faf54dbf8554046f1082ba7 100644 (file)
@@ -855,7 +855,7 @@ void mac_cleanup(JCR *jcr, int TermCode, int writeTermCode)
          db_sql_query(wjcr->db, query.c_str(), NULL, NULL);
       }
    }
-   run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+   run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
 
    /* Runscript could have changed JobStatus,
     * now check if it should be changed in the report or not */
index 911c7523f7dcc6f1cde7d4b44c589cec259b71de..e82e3c479fb7408f28c05973bf50e52c49817fe0 100644 (file)
@@ -661,7 +661,7 @@ void restore_cleanup(JCR *jcr, int TermCode)
    /* Job needs to be marked as terminated before running the after runscript */
    jcr->setJobStatus(TermCode);
 
-   run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+   run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
 
    /* Runscript could have changed JobStatus,
     * now check if it should be changed in the report or not */
index 46539208481dd6baddcfdf7018090ee91c3e2438..aead6f7deba35c4950b7f2ec408487384de002a0 100644 (file)
@@ -405,7 +405,7 @@ void vbackup_cleanup(JCR *jcr, int TermCode)
    /* Job needs to be marked as terminated before running the after runscript */
    jcr->setJobStatus(TermCode);
 
-   run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+   run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
 
    /* Runscript could have changed JobStatus,
     * now check if it should be changed in the report or not */
index 87b081f12ab08cda2c298fbe2c8ce659525de9a5..87079d31653a1b6da291de6a76406b928bc6cb78 100644 (file)
@@ -472,7 +472,7 @@ void verify_cleanup(JCR *jcr, int TermCode)
    /* Job needs to be marked as terminated before running the after runscript */
    jcr->setJobStatus(TermCode);
 
-   run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+   run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
 
    /* Runscript could have changed JobStatus,
     * now check if it should be changed in the report or not */
index 7223d0988f783c57a82a10a7f30ae84306297bcb..4e8d1ae1f3cb292d35e80d78b2eafd724edc44c0 100644 (file)
@@ -107,8 +107,8 @@ int run_scripts(JCR *jcr, alist *runscripts, const char *label)
       when = SCRIPT_Before;
    } else if (bstrcmp(label, NT_("ClientAfterVSS"))) {
       when = SCRIPT_AfterVSS;
-   } else if (bstrcmp(label, NT_("EndJob"))) {
-      when = SCRIPT_EndJob;
+   } else if (bstrcmp(label, NT_("AtJobCompletion"))) {
+      when = SCRIPT_AtJobCompletion;
    } else {
       when = SCRIPT_After;
    }
@@ -152,15 +152,15 @@ int run_scripts(JCR *jcr, alist *runscripts, const char *label)
          }
       }
 
-      if ((script->when & SCRIPT_EndJob) && (when & SCRIPT_EndJob)) {
-         Dmsg1(0, "EndJob jobstatus=%c\n", jcr->JobStatus);
+      if ((script->when & SCRIPT_AtJobCompletion) && (when & SCRIPT_AtJobCompletion)) {
+         Dmsg1(0, "AtJobCompletion jobstatus=%c\n", jcr->JobStatus);
          if ((script->on_success &&
               (jcr->JobStatus == JS_Terminated || jcr->JobStatus == JS_Warnings))
             || (script->on_failure &&
                 (job_canceled(jcr) || jcr->JobStatus == JS_Differences))
             )
          {
-            Dmsg4(200, "runscript: Run it because SCRIPT_EndJob (%s,%i,%i,%c)\n",
+            Dmsg4(200, "runscript: Run it because SCRIPT_AtJobCompletion (%s,%i,%i,%c)\n",
                   script->command, script->on_success, script->on_failure,
                   jcr->JobStatus );
             /* Set job task code */
index 8ce8307c789e13f6adf14a33c5d5ef8a32bfd0ec..a33154e9bf9ff3a715e52248ba8a2ae6db7d4218 100644 (file)
@@ -49,7 +49,7 @@ enum {
    SCRIPT_After  = (1<<0),      /* AfterJob */
    SCRIPT_Before = (1<<1),      /* BeforeJob */
    SCRIPT_AfterVSS = (1<<2),    /* BeforeJob and After VSS */
-   SCRIPT_EndJob = (1<<3),      /* Before AfterJob on the Director, take status in account */
+   SCRIPT_AtJobCompletion = (1<<3),  /* Before AfterJob on the Director, take status in account */
    SCRIPT_Any    = SCRIPT_Before | SCRIPT_After
 };