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

Annotation of /FortyEight/reset_stage.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : olson 1.1 #
2 :     # Reset the given stage of the job, and set the job to active
3 :     # (remove ERROR, touch ACTIVE).
4 :     #
5 :    
6 :     use strict;
7 :     use Job48;
8 :    
9 :     my $usage = "reset_stage jobdir stage";
10 :    
11 :     @ARGV == 2 or die $usage;
12 :    
13 :     my $jobdir = shift;
14 :     my $stage = shift;
15 :    
16 :     my $job = new Job48($jobdir);
17 :    
18 :     if ($job->active())
19 :     {
20 :     print "Job is still active, not changing\n";
21 :     exit;
22 :     }
23 :    
24 :     my $meta = $job->meta;
25 :    
26 :     my $st = $meta->get_metadata("status.$stage");
27 :     if ($st ne 'error')
28 :     {
29 :     print "Job stage $stage is not in error, not changing\n";
30 :     exit;
31 :     }
32 :    
33 :     $meta->set_metadata("status.$stage", "not_started");
34 :     $meta->set_metadata("$stage.running", "no");
35 :    
36 :     my $jd = $job->dir;
37 :     unlink("$jd/ERROR");
38 :     open(T, ">$jd/ACTIVE") or die "cannot touch $jd/ACTIVE: $!";
39 :     close(T);
40 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3