]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl cleanup brestore
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 20 Aug 2007 16:42:55 +0000 (16:42 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 20 Aug 2007 16:42:55 +0000 (16:42 +0000)
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
gui/brestore/brestore.pl

index 3cffa8e235e84b56f5a4e9da641d79d20be491dc..892442079258a067c3cabfd6338e1eda40dd55d4 100644 (file)
@@ -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
 
index 31359ab54206c26370b8ed54a09bbec9f131cd68..6a8da818357256bf68496d20268b5312b3db847f 100755 (executable)
@@ -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) = @_;