]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/bscan.c
kes If operator has rewind tape, print warning, release tape and
[bacula/bacula] / bacula / src / stored / bscan.c
index c65348f6c8e642cce3216b54ff9963dde6210b6e..fde0ba1ff06a960b1e9203d3e768e0a55c11207a 100644 (file)
@@ -154,7 +154,7 @@ int main (int argc, char *argv[])
 
    OSDependentInit();
 
-   while ((ch = getopt(argc, argv, "b:c:dD:h:p:mn:pP:rsStu:vV:w:?")) != -1) {
+   while ((ch = getopt(argc, argv, "b:c:dD:h:p:mn:pP:rsSt:u:vV:w:?")) != -1) {
       switch (ch) {
       case 'S' :
          showProgress = true;
@@ -619,7 +619,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
                jr.VolSessionTime = mjcr->VolSessionTime;
                jr.JobTDate = (utime_t)mjcr->start_time;
                jr.ClientId = mjcr->ClientId;
-               if (!db_update_job_end_record(bjcr, db, &jr)) {
+               if (!db_update_job_end_record(bjcr, db, &jr, false)) {
                   Pmsg1(0, _("Could not update job record. ERR=%s\n"), db_strerror(db));
                }
                mjcr->read_dcr = NULL;
@@ -845,7 +845,11 @@ static int create_file_attributes_record(B_DB *db, JCR *mjcr,
    ar.ClientId = mjcr->ClientId;
    ar.JobId = mjcr->JobId;
    ar.Stream = rec->Stream;
-   ar.FileIndex = rec->FileIndex;
+   if (type == FT_DELETED) {
+      ar.FileIndex = 0;
+   } else {
+      ar.FileIndex = rec->FileIndex;
+   }
    ar.attr = ap;
    if (dcr->VolFirstIndex == 0) {
       dcr->VolFirstIndex = rec->FileIndex;
@@ -1118,7 +1122,7 @@ static int update_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *elabel,
       return 1;
    }
 
-   if (!db_update_job_end_record(bjcr, db, jr)) {
+   if (!db_update_job_end_record(bjcr, db, jr, false)) {
       Pmsg2(0, _("Could not update JobId=%u record. ERR=%s\n"), jr->JobId,  db_strerror(db));
       free_jcr(mjcr);
       return 0;