#!/usr/bin/perl
use strict;
use warnings;
my $nvbu_path = "/usr/netvault/";
my $file_list = "tmp/jobid.lst";
my $nvjobabort = "util/nvjobabort";
my $nvreport = "util/nvreport";
my $template = "reports/templates/cli_activejobs";
substr($file_list,0,0) = $nvbu_path;
substr($nvjobabort,0,0) = $nvbu_path;
substr($nvreport,0,0) = $nvbu_path;
substr($template,0,0) = $nvbu_path;
`$nvreport -templatefile $template > $file_list`;
open my $fh, "<", $file_list or die "$!:$file_list";
while (my $line = <$fh>)
{
if ($line =~ /[0-9]+?,[0-9]+?/)
{
my @id_list = split(/,/, $line);
my $jobid = $id_list[0];
my $insid = $id_list[1];
system "$nvjobabort -jobid $jobid -instanceid $insid";
}
}
close $fh;