]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/fd_cmds.c
Add heap stats to Dir and SD -- eliminate #ifdefs
[bacula/bacula] / bacula / src / dird / fd_cmds.c
index 27c41b68b21915822ed210edf46af14d57620bb4..c37db4900a77753119902c1a786f06b81412b6d1 100644 (file)
@@ -40,6 +40,7 @@ static char inc[]         = "include\n";
 static char exc[]         = "exclude\n";
 static char fileset[]     = "fileset\n"; /* set full fileset */
 static char jobcmd[]      = "JobId=%d Job=%s SDid=%u SDtime=%u Authorization=%s\n";
+/* Note, mtime_only is not used here -- implemented as file option */
 static char levelcmd[]    = "level = %s%s mtime_only=%d\n";
 static char runbefore[]   = "RunBeforeJob %s\n";
 static char runafter[]    = "RunAfterJob %s\n";
@@ -139,8 +140,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
  */
 void get_level_since_time(JCR *jcr, char *since, int since_len)
 {
-   /* Lookup the last
-    * FULL backup job to get the time/date for a 
+   /* Lookup the last FULL backup job to get the time/date for a 
     * differential or incremental save.
     */
    if (!jcr->stime) {
@@ -152,20 +152,21 @@ void get_level_since_time(JCR *jcr, char *since, int since_len)
    case L_DIFFERENTIAL:
    case L_INCREMENTAL:
       /* Look up start time of last job */
-      jcr->jr.JobId = 0;
+      jcr->jr.JobId = 0;     /* flag for db_find_job_start time */
       if (!db_find_job_start_time(jcr, jcr->db, &jcr->jr, &jcr->stime)) {
          Jmsg(jcr, M_INFO, 0, "%s", db_strerror(jcr->db));
          Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found. Doing FULL backup.\n"));
          bsnprintf(since, since_len, " (upgraded from %s)", 
            level_to_str(jcr->JobLevel));
-        jcr->JobLevel = jcr->jr.Level = L_FULL;
+        jcr->JobLevel = jcr->jr.JobLevel = L_FULL;
       } else {
          bstrncpy(since, ", since=", since_len);
         bstrncat(since, jcr->stime, since_len);
       }
-      Dmsg1(100, "Last start time = %s\n", jcr->stime);
+      jcr->jr.JobId = jcr->JobId;
       break;
    }
+   Dmsg2(100, "Level=%c last start time=%s\n", jcr->JobLevel, jcr->stime);
 }
 
 
@@ -264,11 +265,11 @@ static int send_list(JCR *jcr, int list)
            } else {
                bstrncpy(buf, "0 ", sizeof(buf));
            }
-            Dmsg1(100, "Opts=%s\n", buf);
+            Dmsg1(500, "Opts=%s\n", buf);
            optlen = strlen(buf);
            while (fgets(buf+optlen, sizeof(buf)-optlen, bpipe->rfd)) {
                fd->msglen = Mmsg(&fd->msg, "%s", buf);
-               Dmsg2(200, "Inc/exc len=%d: %s", fd->msglen, fd->msg);
+               Dmsg2(500, "Inc/exc len=%d: %s", fd->msglen, fd->msg);
               if (!bnet_send(fd)) {
                   Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n"));
                  goto bail_out;
@@ -294,7 +295,7 @@ static int send_list(JCR *jcr, int list)
            } else {
                bstrncpy(buf, "0 ", sizeof(buf));
            }
-            Dmsg1(100, "Opts=%s\n", buf);
+            Dmsg1(500, "Opts=%s\n", buf);
            optlen = strlen(buf);
            while (fgets(buf+optlen, sizeof(buf)-optlen, ffd)) {
                fd->msglen = Mmsg(&fd->msg, "%s", buf);
@@ -310,14 +311,14 @@ static int send_list(JCR *jcr, int list)
            /* Note, fall through wanted */
         default:
            if (ie->num_opts) {
-               Dmsg2(100, "numopts=%d opts=%s\n", ie->num_opts, NPRT(ie->opts_list[0]->opts));
+               Dmsg2(500, "numopts=%d opts=%s\n", ie->num_opts, NPRT(ie->opts_list[0]->opts));
               pm_strcpy(&fd->msg, ie->opts_list[0]->opts);
                pm_strcat(&fd->msg, " ");
            } else {
                pm_strcpy(&fd->msg, "0 ");
            }
            fd->msglen = pm_strcat(&fd->msg, p);
-            Dmsg1(100, "Inc/Exc name=%s\n", fd->msg);
+            Dmsg1(500, "Inc/Exc name=%s\n", fd->msg);
            if (!bnet_send(fd)) {
                Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n"));
               goto bail_out;
@@ -403,11 +404,11 @@ static int send_fileset(JCR *jcr)
                  goto bail_out;
               }
                bstrncpy(buf, "F ", sizeof(buf));
-               Dmsg1(100, "Opts=%s\n", buf);
+               Dmsg1(500, "Opts=%s\n", buf);
               optlen = strlen(buf);
               while (fgets(buf+optlen, sizeof(buf)-optlen, bpipe->rfd)) {
                   fd->msglen = Mmsg(&fd->msg, "%s", buf);
-                  Dmsg2(200, "Inc/exc len=%d: %s", fd->msglen, fd->msg);
+                  Dmsg2(500, "Inc/exc len=%d: %s", fd->msglen, fd->msg);
                  if (!bnet_send(fd)) {
                      Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n"));
                     goto bail_out;
@@ -427,7 +428,7 @@ static int send_fileset(JCR *jcr)
                  goto bail_out;
               }
                bstrncpy(buf, "F ", sizeof(buf));
-               Dmsg1(100, "Opts=%s\n", buf);
+               Dmsg1(500, "Opts=%s\n", buf);
               optlen = strlen(buf);
               while (fgets(buf+optlen, sizeof(buf)-optlen, ffd)) {
                   fd->msglen = Mmsg(&fd->msg, "%s", buf);
@@ -444,7 +445,7 @@ static int send_fileset(JCR *jcr)
            default:
                pm_strcpy(&fd->msg, "F ");
               fd->msglen = pm_strcat(&fd->msg, p);
-               Dmsg1(100, "Inc/Exc name=%s\n", fd->msg);
+               Dmsg1(500, "Inc/Exc name=%s\n", fd->msg);
               if (!bnet_send(fd)) {
                   Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n"));
                  goto bail_out;
@@ -495,6 +496,9 @@ int send_include_list(JCR *jcr)
 int send_exclude_list(JCR *jcr)
 {
    BSOCK *fd = jcr->file_bsock;
+   if (jcr->fileset->new_include) {
+      return 1;
+   }
    bnet_fsend(fd, exc);
    return send_list(jcr, EXC_LIST);
 }
@@ -509,7 +513,7 @@ int send_bootstrap_file(JCR *jcr)
    FILE *bs;
    char buf[1000];
    BSOCK *fd = jcr->file_bsock;
-   char *bootstrap = "bootstrap\n";
+   const char *bootstrap = "bootstrap\n";
 
    Dmsg1(400, "send_bootstrap_file: %s\n", jcr->RestoreBootstrap);
    if (!jcr->RestoreBootstrap) {