From: Nicolas Boichat Date: Tue, 18 Oct 2005 18:32:46 +0000 (+0000) Subject: Modify .backups command to get a fileset parameter (fix bug #444). X-Git-Tag: Release-1.38.0~51 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a10a7c00d10d2b491f71252fb44838079db756cf;p=bacula%2Fbacula Modify .backups command to get a fileset parameter (fix bug #444). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2464 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/nb-1.37 b/bacula/nb-1.37 index e879828837..8951596e42 100644 --- a/bacula/nb-1.37 +++ b/bacula/nb-1.37 @@ -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. diff --git a/bacula/src/dird/sql_cmds.c b/bacula/src/dird/sql_cmds.c index f5384140c3..db289413b9 100644 --- a/bacula/src/dird/sql_cmds.c +++ b/bacula/src/dird/sql_cmds.c @@ -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"; diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index db41f08611..16ad9210da 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -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; diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index 1c8eb647a2..a8bce02980 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -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; }