my $op_move_to;
my $queue_name;
+my $filenames;
my $given_job;
my $summary;
my $why;
--move-to=<queue> Move jobs to a different queue
Options:
+-f, --filenames Show filenames of jobs and log files
-j, --job=<id> Act on the specified job (default: on all)
-q, --queue=<name> Act on the given queue
-s, --summary Show only a summary
"h|by-host!" => \$op_by_host,
"rm!" => \$op_rm,
"move-to=s" => \$op_move_to,
+ "f|filenames!" => \$filenames,
"j|job=s" => \$given_job,
"q|queue=s" => \$queue_name,
"s|summary!" => \$summary,
my $s = $st->{"Status"} // "UNKNOWN";
$cnt_by_job{$j}{$s}++;
$cnt_by_mach{$m}{$s}++;
+ $why{$m}{$j} = "";
+ if ($filenames) {
+ $why{$m}{$j} .= "\t\t== Job file: " . $queue->queue_file($m, $j) . "\n";
+ }
if (defined($st->{'Time'}) && defined($st->{'Status'})) {
$stat{$m}{$j} = ' [' . $st->{'Status'} . ' on ' .
POSIX::strftime('%Y-%m-%d', localtime $st->{'Time'}) . ']';
my $lines = $why ? $why : 3;
my $log = $queue->log_file($m, $j);
if (-f $log) {
- $why{$m}{$j} = join("", map { "\t\t>> $_" } `tail -n$lines $log`);
+ $why{$m}{$j} .= join("", map { "\t\t>> $_" } `tail -n$lines $log`);
}
}
} else {
print "$m", ($mach_locked{$m} ? ' [LOCKED]' : ''), "\n";
for my $j (@{$machs{$m}}) {
print "\t" . $queue->job_name($j) . $stat{$m}{$j}, "\n";
- print $why{$m}{$j} // "";
+ print $why{$m}{$j};
}
}
} else {
print $queue->job_name($j), "\n";
for my $m (sort @{$jobs{$j}}) {
print "\t$m", $stat{$m}{$j}, "\n";
- print $why{$m}{$j} // "";
+ print $why{$m}{$j};
}
}
}