#!/usr/bin/perl
+use Getopt::Std;
+
BEGIN{
$prefix = "/tmp/purge_test_$$";
$delay = 60;
+getopts 's:';
+
$ENV{PATH} .= ":$bin";
}
Don't run it unless you are absolutely sure what you are doing.
If you really mean it, the magic usage is:
- $0 --i-want-to-purge server:port
+ $0 [-s sleep] i-want-to-purge server:port
Good luck!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-} unless $option eq '--i-want-to-purge';
+} unless $option eq 'i-want-to-purge';
die "usage: $0 --i-want-to-purge server:port\n" unless $server;
$id =~ s/EDG_JOBID=//;
$ids->{$key} = $id;
#print "$status $id | head -1\n";
+ sleep $opt_s;
$stat = `$status $id | head -2 | tail -1`;
chomp $stat;
$stat =~ s/state :\s*//;
-#print "$id: ".uc($stat)." ".uc($_)."\n";
- $failed = 1 if uc($stat) ne uc($_);
+ if (uc($stat) ne uc($_)) {
+ $failed = 1;
+ print STDERR "FAIL: $id: ".uc($stat)." ".uc($_)."\n";
+ }
system "$log $id | grep -v '^[ ]*\$' | grep -v '^Found' >${prefix}_$_";
}