#!/usr/bin/perl use strict; use warnings; 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; my $name = $_; print "$name \n"; my $ntfile = "\"\\\\$name\\c\$\\WINNT\\Profiles\\All Users\\Application Data\\Network Associates\\VirusScan\\UpdateLog.txt\""; my $isfile = `dir /B $ntfile`; if ($isfile ne "") { my $fname = "//$name/c\$/WINNT/Profiles/All Users/Application Data/Network Associates/VirusScan/UpdateLog.txt"; print "${name}'s system is NT!\n"; STUFF ($name, $fname); } else { my $fname = "//$name/c\$/Documents and Settings/All Users/Application Data/Network Associates/VirusScan/UpdateLog.txt"; print "${name}'s system is XP!\n"; STUFF ($name, $fname); } } close NODELIST; close TIMES; sub STUFF { my ($name, $fname) = @_; my $modded = -M $fname; return if $modded < 2; print TIMES "Server Name: $name\n"; print TIMES "$modded\n\n"; }