Commit a815ce6f authored by Leigh Stoller's avatar Leigh Stoller

Make sure a copy of the parameters file gets into the archive each

time a run starts. This info is stored in the DB forever, but a file
in the archive is a nice thing too.
parent 588c46d0
......@@ -1743,6 +1743,7 @@ sub template($) { return ((!ref($_[0])) ? -1 : $_[0]->{'TEMPLATE'}); }
# The path is the path of the experiment.
sub path($) { return TBExptUserDir($_[0]->pid(), $_[0]->eid()); }
sub workdir($) { return TBExptWorkDir($_[0]->pid(), $_[0]->eid()); }
#
# Stringify for output.
......
......@@ -77,6 +77,7 @@ my $TBLOGS = "@TBLOGSEMAIL@";
my $TBDOCBASE = "@TBDOCBASE@";
my $TBBASE = "@TBBASE@";
my $CONTROL = "@USERNODE@";
my $PARAMS = "parameters.xml";
# Locals
my $user_name;
......@@ -293,6 +294,10 @@ if (defined($paramfile)) {
# User sees this error.
exit(1)
if ($donebad);
# Save away for later since returning to web interface deletes it.
system("/bin/cp", $paramfile, $instance->workdir() . "/$PARAMS") == 0
or fatal(-1, "Could not save $paramfile to workdir");
}
#
......@@ -492,6 +497,20 @@ if ($doswapmod) {
or fatal(-1, "Could not write program agent info");
}
#
# Now we stash the parameter file for the next version of the archive.
#
if (defined($paramfile)) {
my $source = $instance->workdir() . "/$PARAMS";
my $target = $instance->path() . "/archive/$PARAMS";
unlink($target)
if (-e $target);
system("/bin/cp", $source, $target) == 0
or fatal(-1, "Could not copy $source to $target");
}
#
# We munge the environment variables *AFTER* the potential swapmod since
# it will have scrogged the user env.
......
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