 +            "JOIN Path     USING (PathId) "
 + "WHERE Path.Path='%s' "
 +   "AND Filename.Name='%s' "
-+   "AND BackupId=%s ",
++   "AND BackupId=%s "
++   "ORDER BY FileId DESC LIMIT 1",
 +	mdb->esc_path,
 +	mdb->esc_name,
 +	edit_int64(backupid, ed1));
 +   
-+   Dmsg1(100,"get_file %s\n", mdb->cmd);
++   Dmsg1(2,"get_file %s\n", mdb->cmd);
 +
 +   if (QUERY_DB(jcr, mdb, mdb->cmd)) {
 +      char ed1[30];

+   mdb->esc_path = check_pool_memory_size(mdb->esc_path, 2*mdb->pnl+2);
+   db_escape_string(jcr, mdb, mdb->esc_path, mdb->path, mdb->pnl);
+
+   Mmsg(mdb->cmd,
+"SELECT FileId, LStat, MD5, FilenameId, PathId, FileIndex, CurrentFile.MarkId, JobId "
+  "FROM File JOIN CurrentFile USING (FileId) "

+	    fdbr->JobId      = str_to_int64(row[7]);
+	    stat=1;
+	 }
+      } 
+      sql_free_result(mdb);
+   } else {
+      Mmsg(mdb->errmsg, _("File record: %s not found in Catalog for BackupId=%s.\n"), fname, ed1);
