Here is the script:
use strict;
use warnings;
use Mail::Sender;
# run the program
my @run1 = ( "M:\\Program Files\\Mincom\\MIMS Open
Enterprise\\5.2.3.2\\bin\\msqupd.exe ", "ellprd" );
my @run2 = ( "M:\\Program Files\\Mincom\\MIMS Open
Enterprise\\5.2.3.2\\bin\\msqupd.exe ", "elltst" );
print "==================================\n";
print " Running popup updates for ELLPRD \n";
print "==================================\n\n";
system(@run1);
print "==================================\n";
print " Running popup updates for ELLTST \n";
print "==================================\n";
system(@run2);
my $file = "M:\\Program Files\\Mincom\\ParadoxMaster\\msqupd.log";
my $uname = $ENV{'COMPUTERNAME'};
my $text;
{
open FILE, $file || die "Ooops $!";
local $/; # slurp mode, local only
$text = <FILE>;
close FILE;
}
my $sender = new Mail::Sender {
smtp => 'mailout.uscg.mil',
from => 'bhicks@osc.uscg.mil',
};
$sender->MailMsg(
{
to => 'bhicks@osc.uscg.mil',
subject => "$uname: Nightly Popups Report",
msg => $text,
}
);
my $timestamp = time;
rename( $file, "$file." . $timestamp ) || die "Couldn't rename: $!";
Thread Previous
|
Thread Next