I created the following script to look for files with the .vsp extension and
it looks at the time stamp as well.
I would like to include a display of all the volumes on the windows server
and then search each one of the volumes it finds.  Any ideas out there?


use Time::localtime;



#if (@ARGV < 1){   # if no directory was passed error out.

#  die "No directory given to scan.\nusage:vsp.pl -a <age in minutes>
<directory>\n"

#}





$dir = @ARGV[0];  # set the directory passed to checkstamp

$dir2 = @ARGV[1];  # set the directory passed to checkstamp

#$dir = "C:\\temp";

unless(-d $dir) { # Check and make sure if the path exists.

  die "Path not found $dir\n"

}



opendir(DIR, "$dir");

  @files = grep(/\.vsp$/i,readdir(DIR)); # get a list of files in the
directory.

closedir(DIR);



open(OUTFILE, ">$dir2");



foreach $file (@files) {

      $timestamp= (stat($dir."/".$file))[9]; # Get the timestamp of the file
(returns epoch time) and add the age.

      $time = int((time() - $timestamp) / 60); # convert to minutes

      print OUTFILE "$file $time \n";

    }

close(OUTFILE);




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to