Commit 77fd68e8 authored by Leigh Stoller's avatar Leigh Stoller

Add code to push the site_mapping table over too.

parent 821e973e
...@@ -27,6 +27,7 @@ my $TB = "@prefix@"; ...@@ -27,6 +27,7 @@ my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@"; my $TBOPS = "@TBOPSEMAIL@";
my $CURL = "/usr/local/bin/curl"; my $CURL = "/usr/local/bin/curl";
my $DATAPOSCGI = "http://www.datapository.net/input/upload.cgi"; my $DATAPOSCGI = "http://www.datapository.net/input/upload.cgi";
my $MAXAGE = (24 * 60 * 60);
my $PWDFILE = "/usr/testbed/etc/pelabdb.pwd"; my $PWDFILE = "/usr/testbed/etc/pelabdb.pwd";
my $tempfile = "/var/tmp/testbed_pelab_dbpush_tempfile"; my $tempfile = "/var/tmp/testbed_pelab_dbpush_tempfile";
...@@ -116,6 +117,21 @@ if (TBDBConnect($DBNAME, $DBUSER, $dbpwd) < 0) { ...@@ -116,6 +117,21 @@ if (TBDBConnect($DBNAME, $DBUSER, $dbpwd) < 0) {
fatal("Could not connect to DB!"); 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. # Get the last index we archived out.
# #
...@@ -246,6 +262,7 @@ sub SendToDatapository($) ...@@ -246,6 +262,7 @@ sub SendToDatapository($)
elsif ($_ =~ /^SUCCESS/) { elsif ($_ =~ /^SUCCESS/) {
$success = 1; $success = 1;
} }
print $_;
} }
close(CHILD_READER); close(CHILD_READER);
waitpid($childpid, 0); waitpid($childpid, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment