 +      return 0;
 +   }
 +   if ((row = sql_fetch_row(mdb)) == NULL) {
-+      Mmsg1(&mdb->errmsg, _("No Job found for: %s.\n"), mdb->cmd);
 +      sql_free_result(mdb);
-+      db_unlock(mdb);
-+      return 0;
-+   }
-+
-+   backupid = str_to_int64(row[0]);
++      if (jcr->JobLevel == L_FULL) {
++	 Mmsg(mdb->cmd,
++	      "INSERT INTO CurrentBackupId (JobName, ClientId, FileSetId) VALUES ('%s', %s, %s)",
++	      jr->Name, ed1, ed2);
++	 if (!INSERT_DB(jcr, mdb, mdb->cmd)) {
++	    db_unlock(mdb);
++	    return 0;
++	 }
++	 backupid = sql_insert_id(mdb, NT_("CurrentBackupId"));
++      } else {
++	 Mmsg1(&mdb->errmsg, _("No Job found for: %s.\n"), mdb->cmd);
++	 backupid = 0;
++      }
++   } else {
++      backupid = str_to_int64(row[0]);
++   }
++
 +   sql_free_result(mdb);
-+
-+   if (backupid <= 0) {
-+      Mmsg1(&mdb->errmsg, _("No Job found for: %s\n"), mdb->cmd);
-+      db_unlock(mdb);
-+      return 0;
-+   }
 +
 +   db_unlock(mdb);
 +   return backupid;

+/* build a fileset with new files from director */
+static bool accurate_get_new_and_deleted_file_list(JCR *jcr)
+{   
+   if (jcr->accurate == false || job_canceled(jcr)) {
+      return true;
+   }
+   return true;
+}
+

+   return stat;
+}
+
+int db_accurate_drop_tobackup_table(JCR *jcr, B_DB *mdb, JobId_t JobId)
+{
+   int stat=0;
+   char ed1[50];
+   db_lock(mdb);
+//   Mmsg(mdb->cmd, "DROP TABLE ToBackup%s", edit_int64(JobId, ed1));
