]> git.sur5r.net Git - bacula/bacula/commitdiff
Modify .backups command to get a fileset parameter (fix bug #444).
authorNicolas Boichat <nicolas@boichat.ch>
Tue, 18 Oct 2005 18:32:46 +0000 (18:32 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Tue, 18 Oct 2005 18:32:46 +0000 (18:32 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2464 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/nb-1.37
bacula/src/dird/sql_cmds.c
bacula/src/dird/ua_dotcmds.c
bacula/src/wx-console/wxbrestorepanel.cpp

index e87982883771462830a7f0316b4a4262fc65014e..8951596e4292549f40e37a6f3394a9c99ff91f05 100644 (file)
@@ -4,6 +4,8 @@
 General:
 
 Changes to 1.37.*:
+18Oct05
+ - Modify .backups command to get a fileset parameter (fix bug #444).
 17Oct05
  - Fix bug when recycling DVD devices (append flag was removed).
  - Add tests for dvd+rw-format in configure script.
index f5384140c3cea1cc18acb6b9aa2b10f669c4b74a..db289413b9afac139cf121fffdd96199de1d86dd 100644 (file)
@@ -30,12 +30,14 @@ const char *list_pool = "SELECT * FROM Pool WHERE PoolId=%s";
 /* For ua_dotcmds.c */
 const char *client_backups =
    "SELECT DISTINCT Job.JobId,Client.Name as Client,Level,StartTime,"
-   "JobFiles,JobBytes,VolumeName,MediaType"
-   " FROM Client,Job,JobMedia,Media"
+   "JobFiles,JobBytes,VolumeName,MediaType,FileSet"
+   " FROM Client,Job,JobMedia,Media,FileSet"
    " WHERE Client.Name='%s'"
+   " AND FileSet='%s'"
    " AND Client.ClientId=Job.ClientId"
    " AND JobStatus='T'"
    " AND JobMedia.JobId=Job.JobId AND JobMedia.MediaId=Media.MediaId"
+   " AND Job.FileSetId=FileSet.FileSetId"
    " ORDER BY Job.StartTime";
 
 
index db41f08611a0ead2a694b09c92e8811c43950946..16ad9210da2e4d78cd4cc01d28b8429a59b3f6a7 100644 (file)
@@ -213,10 +213,10 @@ static int backupscmd(UAContext *ua, const char *cmd)
    if (!open_db(ua)) {
       return 1;
    }
-   if (ua->argc == 2 && strcmp(ua->argk[1], "client") != 0) {
+   if (ua->argc != 3 || strcmp(ua->argk[1], "client") != 0 || strcmp(ua->argk[2], "fileset") != 0) {
       return 1;
    }
-   Mmsg(ua->cmd, client_backups, ua->argv[1]);
+   Mmsg(ua->cmd, client_backups, ua->argv[1], ua->argv[2]);
    if (!db_sql_query(ua->db, ua->cmd, client_backups_handler, (void *)ua)) {
       bsendmsg(ua, _("Query failed: %s. ERR=%s\n"), ua->cmd, db_strerror(ua->db));
       return 1;
index 1c8eb647a238c69da3c9093080cdbbc758b1aa42..a8bce029809902b638d60d4801bfcd077373a91f 100644 (file)
@@ -1220,7 +1220,7 @@ void wxbRestorePanel::CmdConfigCancel() {
    SetStatus(finished);
 }
 
-/* List jobs for a specified client */
+/* List jobs for a specified client and fileset */
 void wxbRestorePanel::CmdListJobs() {
    if (status == entered) {
       configPanel->ClearRowChoices(_("Before"));
@@ -1228,7 +1228,8 @@ void wxbRestorePanel::CmdListJobs() {
       wxbUtils::WaitForPrompt("6\n");*/
       wxbTableParser* tableparser = new wxbTableParser(false);
       wxbDataTokenizer* dt = wxbUtils::WaitForEnd(
-         wxString(wxT(".backups client=")) + configPanel->GetRowString(_("Client")) + wxT("\n"), true);
+         wxString(wxT(".backups client=\"")) + configPanel->GetRowString(_("Client")) + 
+                  wxT("\" fileset=\"") + configPanel->GetRowString(_("Fileset")) + wxT("\"\n"), true);
 
       while (!tableparser->hasFinished()) {
          wxTheApp->Yield(true);
@@ -1800,7 +1801,8 @@ void wxbRestorePanel::UpdateFirstConfig() {
     * where=/tmp/bacula-restores
     * level=0
     * type=Restore
-    * fileset=Full Set */
+    * fileset=***
+    */
    
    wxString name, str;
    unsigned int i;
@@ -1827,7 +1829,12 @@ void wxbRestorePanel::UpdateFirstConfig() {
             configPanel->SetRowString(_("Storage"), str.Mid(j+1));
          }
          else if (name == wxT("fileset")) {
-            configPanel->SetRowString(_("Fileset"), str.Mid(j+1));
+            str = str.Mid(j+1);
+            if ((str != configPanel->GetRowString(_("Fileset"))) ||
+                  (configPanel->GetRowString(_("Before"))) == wxT("")) {
+               configPanel->SetRowString(_("Fileset"), str);
+               dolistjobs = true;
+            }
          }
       }
    }
@@ -2385,7 +2392,7 @@ void wxbRestorePanel::OnConfigUpdated(wxCommandEvent& event) {
          UpdateFirstConfig();
          SetWorking(false);
       }
-      else if (event.GetId() == ConfigClient) {
+      else if ((event.GetId() == ConfigClient) || (event.GetId() == ConfigFileset)) {
          if (IsWorking()) {
             return;
          }