#!/usr/bin/perl use strict; use warnings; my $fname; my $name; my $ntfile; my $isfile; use file::find; print "Backing up old timesNT.txt... \n"; rename ("timesNT.txt", "bac/timesNT.bac") || die "Cannot rename timesNT.txt: $!"; open (NODELIST, "nodelistNT.txt") or die "I could not get at nodelist.txt as input"; open (TIMES, ">>timesNT.txt") or die "I could not open times.txt as output"; my $time = localtime(time()); print TIMES "$time.---------------------------------------------------------------\n\n"; while () { chomp; $name=$_; print "$name \n"; $ntfile = "\"\\\\$name\\c\$\\WINNT\\Profiles\\All Users\\Application Data\\Network Associates\\VirusScan\\UpdateLog.txt\""; # print "$ntfile\n"; $isfile = ""; $isfile = `dir /B $ntfile`; # print "$isfile\n"; if ($isfile ne "") { $fname = "//$name/c\$/WINNT/Profiles/All Users/Application Data/Network Associates/VirusScan/UpdateLog.txt"; print "This system is NT!!!!!!\n"; STUFF(); } else { $fname = "//$name/c\$/Documents and Settings/All Users/Application Data/Network Associates/VirusScan/UpdateLog.txt"; print "This system is XP!!!!!!!!!!!!!!!!!\n"; STUFF(); } } close NODELIST; close TIMES; sub STUFF { my $modded = -M $fname; # print TIMES "Server Name: $name\n"; # print TIMES "$modded\n\n"; if ($modded >= 2) { print TIMES "Server Name: $name\n"; print TIMES "$modded\n\n"; } }