From bf282bf1815c9ca59647f0a889b38b7328d26d48 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 20 Aug 2007 16:42:55 +0000 Subject: [PATCH] ebl cleanup brestore ebl update brestore_xxx only when job is in (T, f, A) git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5384 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/brestore/ReleaseNotes | 4 ++++ gui/brestore/brestore.pl | 28 +--------------------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/gui/brestore/ReleaseNotes b/gui/brestore/ReleaseNotes index 3cffa8e235..8924420792 100644 --- a/gui/brestore/ReleaseNotes +++ b/gui/brestore/ReleaseNotes @@ -1,5 +1,9 @@ Release Notes for brestore 2.2.0 +Version 2.2.0-2: + - cleanup brestore + - update brestore_xxx only when job is in (T, f, A) + Version 2.2.0: - -b now clean brestore internal tables diff --git a/gui/brestore/brestore.pl b/gui/brestore/brestore.pl index 31359ab542..6a8da81835 100755 --- a/gui/brestore/brestore.pl +++ b/gui/brestore/brestore.pl @@ -2392,7 +2392,7 @@ sub update_cache my $query = " SELECT JobId from Job - WHERE JobId NOT IN (SELECT JobId FROM brestore_knownjobid) ORDER BY JobId"; + WHERE JobId NOT IN (SELECT JobId FROM brestore_knownjobid) AND JobStatus IN ('T', 'f', 'A') ORDER BY JobId"; my $jobs = $self->dbh_selectall_arrayref($query); $self->update_brestore_table(map { $_->[0] } @$jobs); @@ -2879,32 +2879,6 @@ sub update_brestore_table } } -sub cleanup_brestore_table -{ - my ($self) = @_; - - my $query = "SELECT JobId from brestore_knownjobid"; - my @jobs = @{$self->dbh_selectall_arrayref($query)}; - - foreach my $jobentry (@jobs) - { - my $job = $jobentry->[0]; - $query = "SELECT FileId from File WHERE JobId = $job LIMIT 1"; - my $result = $self->dbh_selectall_arrayref($query); - if (scalar(@{$result})) - { - # There are still files for this jobid - print STDERR "$job still exists. Not cleaning...\n"; - - } else { - $query = "DELETE FROM brestore_pathvisibility WHERE JobId = $job"; - $self->dbh_do($query); - $query = "DELETE FROM brestore_knownjobid WHERE JobId = $job"; - $self->dbh_do($query); - } - } -} - sub parent_dir { my ($path) = @_; -- 2.39.5