sub farmInput {
my($corp, $finalPath) = ($_[0], $_[1]);
my $path = "/usr/local/farm/*/*/$finalPath/*$corp*";
my @farms = glob($path);
foreach my $farm (@farms) {
my $s = stat($farm);
printf "%s: Age [%s], size [%d]\n", $farm, ParseDateString("epoch $s->mtime()"), $s->size();
# printf "%s: Age [%s], size [%d]\n", $farm, $s->mtime(), $s->size();
} # end of foreach statement
} # end farmInput
####
printf "%s: Age [%s], size [%d]\n", $farm, ParseDateString("epoch $s->mtime()"), $s->size();
####
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.bctl.e.let.dat.Z: Age [], size [2069]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.bills.let.dat.Z: Age [], size [266666425]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.billvldt.let.dat.Z: Age [], size [72]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.bmsg.e.let.dat.Z: Age [], size [2428]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.brels.let.dat.Z: Age [], size [8]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.callfile.call.dat.Z: Age [], size [126369639]
####
printf "%s: Age [%s], size [%d]\n", $farm, $s->mtime(), $s->size();
####
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.bctl.e.let.dat.Z: Age [1106013532], size [2069]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.bills.let.dat.Z: Age [1106018445], size [266666425]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.billvldt.let.dat.Z: Age [1106018446], size [72]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.bmsg.e.let.dat.Z: Age [1106013532], size [2428]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.brels.let.dat.Z: Age [1106013532], size [8]
/usr/local/farm/vrsn/verisignx/input/75192.hosoft.01162005.A.callfile.call.dat.Z: Age [1106020765], size [126369639]
####
#!/usr/bin/perl
use strict;
use File::stat;
use Date::Manip;
# This is a program that is intended to allow FEP operators
# a tool that will facilitate in monitoring incoming transmissions
# and preprocessor logs.
#------------------- Define Subroutines ------------------#
#
#
# Main is a subroutine simply written for flow control
sub Main {
my $corp = $_[0];
print "Input:\n";
farmInput($corp,'input');
} # end Main
# farmInput does a wildcard search of all /usr/local/farm/*/*/input folders
# looking for the corp number and printing those files to screen.
sub farmInput {
my($corp, $finalPath) = ($_[0], $_[1]);
my $path = "/usr/local/farm/*/*/$finalPath/*$corp*";
my @farms = glob($path);
foreach my $farm (@farms) {
my $s = stat($farm);
printf "%s: Age [%s], size [%d]\n", $farm, ParseDateString("epoch $s->mtime()"), $s->size();
# printf "%s: Age [%s], size [%d]\n", $farm, $s->mtime(), $s->size();
} # end of foreach statement
} # end farmInput
#------------------- End Subroutines ---------------------#
print "What corp are you looking for? " ;
chomp(my $whatWeWant = );
Main($whatWeWant);