-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprintFinishedJobs.pl
39 lines (30 loc) · 1001 Bytes
/
printFinishedJobs.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl
##############################################################################
# Mina Jafari, 29 May 2015 #
# Purpose: This script checks the walltime and elapsed time for the running #
# jobs, if the time difference is less than or equal to 20 hours, it adds 24 #
# hours to the walltime of the job. #
##############################################################################
use strict;
use warnings;
#use Scalar::Util qw(looks_like_number);
my $userID = `whoami`;
my $screenOut = `qstat -tau $userID`;
my @listOfJobs = split /\n/, $screenOut;
my @check;
shift @listOfJobs;
shift @listOfJobs;
shift @listOfJobs;
shift @listOfJobs;
shift @listOfJobs;
for (@listOfJobs)
{
push @check, $_;
@check = split / +/, $_;
push my @jobID, $check[0];
@jobID = split /\./, $check[0];
if (index($jobID[0], "[") != -1)
{
$jobID[0] =~ s/(\[1\])/\[\]/g;
}
}