]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/job.c
- Start implementing Christopher's St.Bernard code.
[bacula/bacula] / bacula / src / filed / job.c
index ac389dc45dde022d5594e4ef1cbdc6df5c3fb3ae..91235844f2593e4f14a45aefca1358145f02ae8d 100644 (file)
@@ -1058,6 +1058,7 @@ static int level_cmd(JCR *jcr)
          goto bail_out;
       }
       since_time = str_to_uint64(buf);  /* this is the since time */
+      Dmsg1(100, "since_time=%d\n", (int)since_time);
       char ed1[50], ed2[50];
       /*
        * Sync clocks by polling him for the time. We take
@@ -1077,8 +1078,10 @@ static int level_cmd(JCR *jcr)
          }
          his_time = str_to_uint64(buf);
          rt = get_current_btime() - bt_start; /* compute round trip time */
-         bt_adj -= his_time - bt_start - rt/2;
-         Dmsg2(200, "rt=%s adj=%s\n", edit_uint64(rt, ed1), edit_uint64(bt_adj, ed2));
+         Dmsg2(100, "Dirtime=%s FDtime=%s\n", edit_uint64(his_time, ed1),
+               edit_uint64(bt_start, ed2));
+         bt_adj +=  bt_start - his_time - rt/2;
+         Dmsg2(100, "rt=%s adj=%s\n", edit_uint64(rt, ed1), edit_uint64(bt_adj, ed2));
       }
 
       bt_adj = bt_adj / 8;            /* compute average time */
@@ -1190,6 +1193,18 @@ static int backup_cmd(JCR *jcr)
    int SDJobStatus;
    char ed1[50], ed2[50];
 
+#ifdef WIN32_VSS
+   // capture state here, if client is backed up by multiple directors
+   // and one enables vss and the other does not then enable_vss can change
+   // between here and where its evaluated after the job completes.
+   bool bDoVSS = false;
+
+   bDoVSS = g_pVSSClient && enable_vss;
+   if (bDoVSS)
+      /* Run only one at a time */
+      P(vss_mutex);
+#endif
+
    set_jcr_job_status(jcr, JS_Blocked);
    jcr->JobType = JT_BACKUP;
    Dmsg1(100, "begin backup ff=%p\n", jcr->ff);
@@ -1240,9 +1255,7 @@ static int backup_cmd(JCR *jcr)
 
 #ifdef WIN32_VSS
    /* START VSS ON WIN 32 */
-   if (g_pVSSClient && enable_vss) {
-      /* Run only one at a time */
-      P(vss_mutex);
+   if (bDoVSS) {      
       if (g_pVSSClient->InitializeForBackup()) {   
         /* tell vss which drives to snapshot */   
         char szWinDriveLetters[27];   
@@ -1256,7 +1269,7 @@ static int backup_cmd(JCR *jcr)
                size_t i;
                for (i=0; i<strlen (szWinDriveLetters); i++) {
                   if (islower(szWinDriveLetters[i])) {
-                     Jmsg(jcr, M_WARNING, 0, _("Generate VSS snapshot of drive \"%c:\\\" failed\n"), szWinDriveLetters[i]);
+                     Jmsg(jcr, M_WARNING, 0, _("Generate VSS snapshot of drive \"%c:\\\" failed. VSS support is disabled on this drive.\n"), szWinDriveLetters[i]);
                      jcr->Errors++;
                   }
                }
@@ -1334,7 +1347,7 @@ cleanup:
 #ifdef WIN32_VSS
    /* STOP VSS ON WIN 32 */
    /* tell vss to close the backup session */
-   if (g_pVSSClient && enable_vss) {
+   if (bDoVSS) {
       if (g_pVSSClient->CloseBackup()) {             
          /* inform user about writer states */
          for (size_t i=0; i<g_pVSSClient->GetWriterCount(); i++) {