From 7254154ac48074ce607cbd65fa4b0fa48c8e6144 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 21 Oct 2008 11:34:20 +0000 Subject: [PATCH] ebl Rename JobStat table, fix couple of warning git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7860 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/cgi/bgraph.pl | 6 +++--- gui/bweb/lib/Bweb.pm | 4 ++-- gui/bweb/script/bweb-postgresql.sql | 4 +++- gui/bweb/script/update_job_old.sql | 8 ++++---- gui/bweb/technotes-2.3 | 3 +++ 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gui/bweb/cgi/bgraph.pl b/gui/bweb/cgi/bgraph.pl index 6389b1c2f2..180663376f 100755 --- a/gui/bweb/cgi/bgraph.pl +++ b/gui/bweb/cgi/bgraph.pl @@ -55,9 +55,9 @@ my $debug = $bweb->{debug}; # Job table keep use Media or Job retention, so it's quite enought # for good statistics -# CREATE TABLE job_old (LIKE Job); -# INSERT INTO job_old -# (SELECT * FROM Job WHERE JobId NOT IN (SELECT JobId FROM job_old) ); +# CREATE TABLE JobHistory (LIKE Job); +# INSERT INTO JobHistory +# (SELECT * FROM Job WHERE JobId NOT IN (SELECT JobId FROM JobHistory) ); my $jobt = $bweb->get_stat_table(); my $graph = CGI::param('graph') || 'job_size'; diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index 7d201d1219..7fb7b05781 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -1876,7 +1876,7 @@ sub get_form } if ($what{storage_cmd}) { - if (!grep {/^$ret{storage_cmd}$/} ('mount', 'umount', 'release','status')) { + if (!grep {/^\Q$ret{storage_cmd}$/} ('mount', 'umount', 'release','status')) { delete $ret{storage_cmd}; } } @@ -1890,7 +1890,7 @@ sub get_form } if ($what{since}) { - my $age = $ret{age} || $opt_i{age}; + my $age = $ret{age} || human_sec_unit($opt_i{age}); my $since = CGI::param('since') || strftime('%F %T', localtime(time - $age)); if ($since =~ /^(\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?)$/) { $ret{since} = $1; diff --git a/gui/bweb/script/bweb-postgresql.sql b/gui/bweb/script/bweb-postgresql.sql index d06820c342..9c20d7b110 100644 --- a/gui/bweb/script/bweb-postgresql.sql +++ b/gui/bweb/script/bweb-postgresql.sql @@ -1,3 +1,6 @@ +-- Require > 7.4, else use createlang command +CREATE PROCEDURAL LANGUAGE plpgsql; + -- -------------------------------------------------- -- Upgrade from 2.2 -- -------------------------------------------------- @@ -210,7 +213,6 @@ COMMIT; -- -- -CREATE PROCEDURAL LANGUAGE plpgsql; BEGIN; CREATE FUNCTION SEC_TO_TIME(timestamp with time zone) diff --git a/gui/bweb/script/update_job_old.sql b/gui/bweb/script/update_job_old.sql index a922246a4b..7a81af2621 100644 --- a/gui/bweb/script/update_job_old.sql +++ b/gui/bweb/script/update_job_old.sql @@ -1,8 +1,8 @@ --- First, create job_old table --- CREATE TABLE job_old (LIKE Job); +-- First, create JobHistory table +-- CREATE TABLE JobHistory (LIKE Job); -- -- then put this on your crontab -- */20 * * * * psql -f /opt/bacula/etc/update_job_old.sql > /home/bacula/update_job_old.log -INSERT INTO job_old - (SELECT * FROM Job WHERE JobStatus in ('T', 'f', 'A') AND JobId NOT IN (SELECT JobId FROM job_old) ); +INSERT INTO JobHistory + (SELECT * FROM Job WHERE JobStatus in ('T', 'f', 'A') AND JobId NOT IN (SELECT JobId FROM JobHistory) ); diff --git a/gui/bweb/technotes-2.3 b/gui/bweb/technotes-2.3 index 1480f5abf3..12058b5b7e 100644 --- a/gui/bweb/technotes-2.3 +++ b/gui/bweb/technotes-2.3 @@ -1,3 +1,6 @@ +20Oct08 +ebl Rename job_old to JobHistory + 07Oct08 ebl Add base64_decode_lstat() function to Mysql -- 2.39.5