Commit 760e3a13 authored by Leigh Stoller's avatar Leigh Stoller

Add purge option to make it easy to completely clear DB state for an

experiment. Useful after a script error.
parent b714591f
...@@ -23,7 +23,7 @@ use strict; ...@@ -23,7 +23,7 @@ use strict;
sub usage() sub usage()
{ {
print(STDERR print(STDERR
"Usage: endexp [-q] [-b | -w] <eid>\n". "Usage: endexp [-q] [-p] [-b | -w] <eid>\n".
"switches and arguments:\n". "switches and arguments:\n".
"-w - wait for non-batchmode experiment terminate\n". "-w - wait for non-batchmode experiment terminate\n".
"-q - be less chatty\n". "-q - be less chatty\n".
...@@ -33,10 +33,11 @@ sub usage() ...@@ -33,10 +33,11 @@ sub usage()
sub fatal($;$); sub fatal($;$);
my $optlist = "bwqx"; my $optlist = "bwqxp";
my $waitmode = 0; my $waitmode = 0;
my $batch = 0; my $batch = 0;
my $quiet = 0; my $quiet = 0;
my $purge = 0;
my $template_mode = 0; my $template_mode = 0;
# #
...@@ -114,6 +115,9 @@ if (@ARGV != 1) { ...@@ -114,6 +115,9 @@ if (@ARGV != 1) {
if (defined($options{"b"})) { if (defined($options{"b"})) {
$batch = 1; $batch = 1;
} }
if (defined($options{"p"})) {
$purge = 1;
}
if (defined($options{"w"})) { if (defined($options{"w"})) {
$waitmode = 1; $waitmode = 1;
} }
...@@ -493,9 +497,10 @@ if (!$template_mode) { ...@@ -493,9 +497,10 @@ if (!$template_mode) {
} }
# #
# Cleanup DB state and remove directory. # Cleanup DB state and remove directory. Purge flag is optional and generally
# used by admins for cleaning up bad DB state caused by script errors.
# #
$experiment->Delete(); $experiment->Delete($purge);
# #
# In batch mode, exit now. # In batch mode, exit now.
......
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