 +      goto bail_out2;
 +   }
 +
-+   /* Now find all the files that are missing -- i.e. all files in
-+    *  the database where the MarkId != current JobId
-+    */
-+
-+   bsnprintf(buf, sizeof(buf),
-+      "SELECT Path.Path,Filename.Name "
-+        "FROM CurrentFile "
-+             "JOIN File USING (FileId) "
-+             "JOIN Path USING (PathId) "
-+             "JOIN Filename USING (FilenameId) "
-+      "WHERE CurrentFile.BackupId=%s "
-+        "AND CurrentFile.MarkId!=%s ",
-+	     edit_uint64(backupid, ed1), edit_uint64(jcr->JobId, ed2));
-+   /* missing_handler is called for each file found */
-+   Dmsg1(1, "display deleted files cmd=%s\n", buf);
-+   db_sql_query(jcr->db, buf, missing_handler, (void *)jcr);
-+
-+   bsnprintf(buf, sizeof(buf),
-+	     "SELECT Name FROM ToBackup%s",
-+	     edit_uint64(jcr->JobId, ed2));
-+   /* missing_handler is called for each file found */
-+   Dmsg1(1, "display files to backup cmd=%s\n", buf);
-+   db_sql_query(jcr->db, buf, missing_handler, (void *)jcr);
++/*
++CREATE  VIEW cf AS SELECT path.path || filename.name as filename, 
++       jobid, currentfile.markid, backupid 
++  FROM File join currentfile using (fileid) join filename using (filenameid) join path using (pathid)
++*/
++
++   accurate_send_missing_and_deleted_files(jcr, backupid);
++
++   db_accurate_clean_deleted_files(jcr, jcr->db, jcr->JobId, backupid);
++
++   db_accurate_drop_tobackup_table(jcr, jcr->db, jcr->JobId);
 +
 +   free_pool_memory(fname);
-+
 +   return true;
 +
 +bail_out2:
-+   db_accurate_drop_backup_table(jcr, jcr->db, jcr->JobId);
++   db_accurate_drop_tobackup_table(jcr, jcr->db, jcr->JobId);
 +   return false;
 +}
 +

 /*
  * Find JobId of last job that ran.  E.g. for
  *   VERIFY_CATALOG we want the JobId of the last INIT.
Index: src/cats/sql_create.c
===================================================================
--- src/cats/sql_create.c	(rvision 6374)

  * Do a backup of the specified FileSet
  *
  *  Returns:  false on failure
@@ -231,9 +637,18 @@
       goto bail_out;
    }
 
