]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/fd_cmds.c
Jobq.c race bug fixed + minor updates
[bacula/bacula] / bacula / src / dird / fd_cmds.c
index ce37b347774dec2f90534c4962930280c68f2c93..3f7be74d69aa35e71849d324043f33e9dde17fee 100644 (file)
@@ -65,7 +65,8 @@ extern int FDConnectTimeout;
 
 /*
  * Open connection with File daemon. 
- * Try connecting every 10 seconds, give up after 1 hour.
+ * Try connecting every retry_interval (default 10 sec), and
+ *   give up after max_retry_time (default 30 mins).
  */
 
 int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
@@ -128,7 +129,13 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
    return 1;
 }
 
-
+/*
+ * This subroutine edits the last job start time into a
+ *   "since=date/time" buffer that is returned in the  
+ *   variable since.  This is used for display purposes in
+ *   the job report.  The time in jcr->stime is later 
+ *   passed to tell the File daemon what to do.
+ */
 void get_level_since_time(JCR *jcr, char *since, int since_len)
 {
    /* Lookup the last
@@ -155,18 +162,21 @@ void get_level_since_time(JCR *jcr, char *since, int since_len)
          bstrncpy(since, ", since=", since_len);
         bstrncat(since, jcr->stime, since_len);
       }
-      Dmsg1(115, "Last start time = %s\n", jcr->stime);
+      Dmsg1(100, "Last start time = %s\n", jcr->stime);
       break;
    }
 }
 
 
 /*
- * Send level command for backup and estimate  
+ * Send level command to FD. 
+ * Used for backup jobs and estimate command.
  */
 int send_level_command(JCR *jcr) 
 {
    BSOCK   *fd = jcr->file_bsock;
+   utime_t stime;
+   char ed1[50];
    /* 
     * Send Level command to File daemon
     */
@@ -174,12 +184,19 @@ int send_level_command(JCR *jcr)
    case L_BASE:
       bnet_fsend(fd, levelcmd, "base", " ", 0);
       break;
+   /* L_NONE is the console, sending something off to the FD */
+   case L_NONE:
    case L_FULL:
       bnet_fsend(fd, levelcmd, "full", " ", 0);
       break;
    case L_DIFFERENTIAL:
    case L_INCREMENTAL:
-      bnet_fsend(fd, levelcmd, "since ", jcr->stime, 0);
+//    bnet_fsend(fd, levelcmd, "since ", jcr->stime, 0); /* old code, deprecated */
+      stime = str_to_utime(jcr->stime);
+      bnet_fsend(fd, levelcmd, "since_utime ", edit_uint64(stime, ed1), 0);
+      while (bget_dirmsg(fd) >= 0) {  /* allow him to poll us to sync clocks */
+         Jmsg(jcr, M_INFO, 0, "%s\n", fd->msg);
+      }
       break;
    case L_SINCE:
    default:
@@ -236,6 +253,7 @@ static int send_list(JCR *jcr, int list)
         p = (char *)ie->name_list.get(j);
         switch (*p) {
          case '|':
+           p++;                      /* skip over the | */
             fd->msg = edit_job_codes(jcr, fd->msg, p, "");
             bpipe = open_bpipe(fd->msg, 0, "r");
            if (!bpipe) {