]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/backup.c
03Dec05
[bacula/bacula] / bacula / src / dird / backup.c
index 139353da899382af01fd28f0b64650b3c6757a37..f10207a158c8f9d641f94850b829c08371e9cf6b 100644 (file)
@@ -18,7 +18,7 @@
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   version 2 as ammended with additional clauses defined in the
+   version 2 as amended with additional clauses defined in the
    file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
@@ -48,10 +48,19 @@ static char EndJob[]     = "2800 End Job TermCode=%d JobFiles=%u "
  */
 bool do_backup_init(JCR *jcr)
 {
-   FILESET_DBR fsr;
    POOL_DBR pr;
+
+   if (!get_or_create_fileset_record(jcr)) {
+      return false;
+   }
+
+   /* 
+    * Get definitive Job level and since time
+    */
+   get_level_since_time(jcr, jcr->since, sizeof(jcr->since));
+
    /*
-    * Get the Pool record -- first apply any level defined pools
+    * Apply any level related Pool selections
     */
    switch (jcr->JobLevel) {
    case L_FULL:
@@ -91,13 +100,6 @@ bool do_backup_init(JCR *jcr)
    jcr->PoolId = pr.PoolId;               /****FIXME**** this can go away */
    jcr->jr.PoolId = pr.PoolId;
 
-   if (!get_or_create_fileset_record(jcr, &fsr)) {
-      return false;
-   }
-   bstrncpy(jcr->FSCreateTime, fsr.cCreateTime, sizeof(jcr->FSCreateTime));
-
-   get_level_since_time(jcr, jcr->since, sizeof(jcr->since));
-
    Dmsg2(900, "cloned=%d run_cmds=%p\n", jcr->cloned, jcr->job->run_cmds);
    if (!jcr->cloned && jcr->job->run_cmds) {
       char *runcmd;
@@ -136,11 +138,12 @@ bool do_backup(JCR *jcr)
    int tls_need = BNET_TLS_NONE;
    BSOCK   *fd;
    STORE *store;
+   char ed1[100];
 
 
    /* Print Job Start message */
-   Jmsg(jcr, M_INFO, 0, _("Start Backup JobId %u, Job=%s\n"),
-        jcr->JobId, jcr->Job);
+   Jmsg(jcr, M_INFO, 0, _("Start Backup JobId %s, Job=%s\n"),
+        edit_uint64(jcr->JobId, ed1), jcr->Job);
 
    set_jcr_job_status(jcr, JS_Running);
    Dmsg2(100, "JobId=%d JobLevel=%c\n", jcr->jr.JobId, jcr->jr.JobLevel);
@@ -166,7 +169,7 @@ bool do_backup(JCR *jcr)
    /*
     * Now start a job with the Storage daemon
     */
-   if (!start_storage_daemon_job(jcr, jcr->storage, SD_APPEND)) {
+   if (!start_storage_daemon_job(jcr, NULL, jcr->storage)) {
       return false;
    }
    /*
@@ -486,7 +489,7 @@ void backup_cleanup(JCR *jcr, int TermCode)
 
 // bmicrosleep(15, 0);                /* for debugging SIGHUP */
 
-   Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n"
+   Jmsg(jcr, msg_type, 0, _("Bacula %s (%s): %s\n"
 "  JobId:                  %d\n"
 "  Job:                    %s\n"
 "  Backup Level:           %s%s\n"
@@ -513,6 +516,8 @@ void backup_cleanup(JCR *jcr, int TermCode)
 "  FD termination status:  %s\n"
 "  SD termination status:  %s\n"
 "  Termination:            %s\n\n"),
+        VERSION,
+        LSMDATE,
         edt,
         jcr->jr.JobId,
         jcr->jr.Job,