]> git.sur5r.net Git - bacula/bacula/commitdiff
Little fixes for the action_on_purge command
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 30 Sep 2009 17:01:59 +0000 (19:01 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 3 Oct 2009 15:34:05 +0000 (17:34 +0200)
bacula/src/cats/sql_get.c
bacula/src/dird/ua_purge.c
bacula/src/stored/dircmd.c

index 255d7bbf2775493e88a462bbcdd2da92e48c6205..37b32d77c9328f84ffcf38c1504a5d604e1e81c5 100644 (file)
@@ -952,7 +952,7 @@ bool db_get_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
          "MaxVolFiles,Recycle,Slot,FirstWritten,LastWritten,InChanger,"
          "EndFile,EndBlock,VolParts,LabelType,LabelDate,StorageId,"
          "Enabled,LocationId,RecycleCount,InitialWrite,"
-         "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime "
+         "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge "
          "FROM Media WHERE MediaId=%s", 
          edit_int64(mr->MediaId, ed1));
    } else {                           /* find by name */
@@ -962,7 +962,7 @@ bool db_get_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
          "MaxVolFiles,Recycle,Slot,FirstWritten,LastWritten,InChanger,"
          "EndFile,EndBlock,VolParts,LabelType,LabelDate,StorageId,"
          "Enabled,LocationId,RecycleCount,InitialWrite,"
-         "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime "
+         "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge "
          "FROM Media WHERE VolumeName='%s'", mr->VolumeName);
    }
 
@@ -1020,6 +1020,7 @@ bool db_get_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
             mr->RecyclePoolId = str_to_int64(row[34]);
             mr->VolReadTime = str_to_int64(row[35]);
             mr->VolWriteTime = str_to_int64(row[36]);
+            mr->ActionOnPurge = str_to_int32(row[37]);
             
             ok = true;
          }
index d9c967c5044c9f4c798528fca8bca05c08a83958..e63cf1197a866107e63ce41ef205adc854244041 100644 (file)
@@ -599,7 +599,10 @@ bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr)
             sd->signal(BNET_TERMINATE);
             sd->close();
             ua->jcr->store_bsock = NULL;
-         }
+         } else {
+            ua->error_msg(_("Could not connect to storage daemon"));
+           return false;
+        }
       }
 
       pm_strcpy(jcr->VolumeName, mr->VolumeName);
index c7d564c6ecc8ca1879a4b1168f8f383e80fe21f8..042a4ea3d762fb96854df6efdfd3e5bbcfe63fa2 100644 (file)
@@ -887,9 +887,9 @@ static bool action_on_purge_cmd(JCR *jcr)
    int drive;
    int action;
 
-   if (sscanf(dir->msg, "action_on_purge_cmd %127s vol=%s action=%d",
+   if (sscanf(dir->msg, "action_on_purge %127s vol=%s action=%d",
               devname.c_str(), volumename.c_str(), &action) != 3) {
-      dir->fsend(_("3916 Error scanning action_on_purge_cmd command\n"));
+      dir->fsend(_("3916 Error scanning action_on_purge command\n"));
       goto done;
    }