From 77fd68e8c7eb26dce8a482fa071cb4132b10cf04 Mon Sep 17 00:00:00 2001 From: "Leigh B. Stoller" Date: Thu, 2 Mar 2006 20:37:11 +0000 Subject: [PATCH] Add code to push the site_mapping table over too. --- pelab/db/pelab_dbpush.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pelab/db/pelab_dbpush.in b/pelab/db/pelab_dbpush.in index 5dd0e9f86..f281b4fbe 100644 --- a/pelab/db/pelab_dbpush.in +++ b/pelab/db/pelab_dbpush.in @@ -27,6 +27,7 @@ my $TB = "@prefix@"; my $TBOPS = "@TBOPSEMAIL@"; my $CURL = "/usr/local/bin/curl"; my $DATAPOSCGI = "http://www.datapository.net/input/upload.cgi"; +my $MAXAGE = (24 * 60 * 60); my $PWDFILE = "/usr/testbed/etc/pelabdb.pwd"; my $tempfile = "/var/tmp/testbed_pelab_dbpush_tempfile"; @@ -116,6 +117,21 @@ if (TBDBConnect($DBNAME, $DBUSER, $dbpwd) < 0) { fatal("Could not connect to DB!"); } +unlink("${tempfile}.site_mapping") + if (-e "${tempfile}.site_mapping"); + +# +# Grab all entries and store to the file +# +DBQueryFatal("select * from site_mapping ". + "into outfile '${tempfile}.site_mapping' ". + "fields terminated by ' '"); + +SendToDatapository("site_mapping"); + +unlink("${tempfile}.site_mapping") + if (-e "${tempfile}.site_mapping" && !$debug); + # # Get the last index we archived out. # @@ -246,6 +262,7 @@ sub SendToDatapository($) elsif ($_ =~ /^SUCCESS/) { $success = 1; } + print $_; } close(CHILD_READER); waitpid($childpid, 0); -- 2.22.0