#!/usr/bin/perl
use Win32::Process::Info; #Requests to use the
+Win32 Mod
use Date::EzDate; #Requests to use the
+date mod
use File::Copy;
my $printinfo = Win32::Process::Info->new(); #Gets the system proc
+ess info
my @info = $printinfo->GetProcInfo(); #Stored to an array
my $currentdate = Date::EzDate->new(); #Loads the current Da
+te an Time
#
#Manageing Log Files Chronologically
#
$hour = 2;
until ($hour > 26) #Loop to r
+ead all log files
{
opendir(LOGS, "/perl/ass/")|| die "dir not found"; #Opens the
+ folder containing the days log files
@logfiles = readdir(LOGS); #Puts the
+name of all files into an array
closedir(LOGS);
$currentlog = "/perl/ass/@logfiles[$hour]";
chmod (0777, $currentlog) or die "Can't change permissions: $!";
+ #Gives everyone all permissions on all fi
+les in the folder
open(CURRENTLOG, $currentlog)|| die "file not found: $!";
$firstline = <CURRENTLOG>;
$date = substr($firstline,0 ,2);
$hour++;
}
I can't give you a list of owner's and permissions as i'm working in windows and do not know the commands sorry.
http://img.photobucket.com/albums/v230/blundell/errorperl.jpg |