[Bio] / FortyEight / reset_stage.pl Repository:
ViewVC logotype

View of /FortyEight/reset_stage.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Tue Oct 23 18:58:31 2007 UTC (12 years, 5 months ago) by olson
Branch: MAIN
CVS Tags: rast_rel_2009_05_18, rast_rel_2008_06_18, rast_rel_2008_06_16, rast_rel_2008_12_18, rast_rel_2008_07_21, rast_2008_0924, rast_rel_2008_04_23, rast_rel_2008_09_30, rast_rel_2009_0925, rast_rel_2010_0526, rast_rel_2010_0118, mgrast_rel_2008_0924, mgrast_rel_2008_1110_v2, rast_rel_2009_02_05, mgrast_rel_2008_0625, rast_rel_2008_10_09, rast_release_2008_09_29, mgrast_rel_2008_0806, mgrast_rel_2008_0923, mgrast_rel_2008_0919, rast_rel_2009_07_09, mgrast_rel_2008_1110, rast_rel_2008_09_29, mgrast_rel_2008_0917, rast_rel_2008_10_29, rast_rel_2009_03_26, rast_rel_2008_11_24, rast_rel_2008_08_07
Add reset_stage.

#
# Reset the given stage of the job, and set the job to active
# (remove ERROR, touch ACTIVE).
#

use strict;
use Job48;

my $usage = "reset_stage jobdir stage";

@ARGV == 2 or die $usage;

my $jobdir = shift;
my $stage = shift;

my $job = new Job48($jobdir);

if ($job->active())
{
    print "Job is still active, not changing\n";
    exit;
}

my $meta = $job->meta;

my $st = $meta->get_metadata("status.$stage");
if ($st ne 'error')
{
    print "Job stage $stage is not in error, not changing\n";
    exit;
}

$meta->set_metadata("status.$stage", "not_started");
$meta->set_metadata("$stage.running", "no");

my $jd = $job->dir;
unlink("$jd/ERROR");
open(T, ">$jd/ACTIVE") or die "cannot touch $jd/ACTIVE: $!";
close(T);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3