RE: Find Files Based on Age

2002-03-28 Thread Nikola Janceski

Write a really cool subroutine for File::Find
or I can give you an example to work from I recommend perl V5.6.1+ if
you are going to use File::Find

 -Original Message-
 From: Scott Burks [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 28, 2002 2:56 PM
 To: [EMAIL PROTECTED]
 Subject: Find Files Based on Age
 
 
 This might be simple, but I haven't found a solution yet.  I have a
 script that I use on our Unix boxes that uses 'find' to get a list of
 files in a certain directory that are a certain number of days old and
 removes them from the system (find / -name * -mtime +45 -exec 
 rm -rf {}
 \;).  I need to port this to a Windows 2000 Server (he shudders as he
 says this) and haven't been able to find a command or module that will
 do the same search based on the age of the file.  Can anyone clue me
 into some Windows magic please.
 
 Scott Burks
 Systems Administrator
 Trust Company of America
 
 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Find Files Based on Age

2002-03-28 Thread John W. Krahn

Scott Burks wrote:
 
 This might be simple, but I haven't found a solution yet.  I have a
 script that I use on our Unix boxes that uses 'find' to get a list of
 files in a certain directory that are a certain number of days old and
 removes them from the system (find / -name * -mtime +45 -exec rm -rf {}
 \;).  I need to port this to a Windows 2000 Server (he shudders as he
 says this) and haven't been able to find a command or module that will
 do the same search based on the age of the file.  Can anyone clue me
 into some Windows magic please.

You should have a program called find2perl that ships with the standard
distribution.

find2perl / -name * -mtime +45 -exec rm -rf {} \;


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Find Files Based on Age

2002-03-28 Thread Gary Hawkins

From within perl:


 -Original Message-
 From: Scott Burks [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 28, 2002 11:56 AM
 To: [EMAIL PROTECTED]
 Subject: Find Files Based on Age
 
 
 This might be simple, but I haven't found a solution yet.  I have a
 script that I use on our Unix boxes that uses 'find' to get a list of
 files in a certain directory that are a certain number of days old and
 removes them from the system (find / -name * -mtime +45 -exec rm -rf {}
 \;).  I need to port this to a Windows 2000 Server (he shudders as he
 says this) and haven't been able to find a command or module that will
 do the same search based on the age of the file.  Can anyone clue me
 into some Windows magic please.
 
 Scott Burks
 Systems Administrator
 Trust Company of America
 
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Find Files Based on Age

2002-03-28 Thread Gary Hawkins

From within perl using built-in functions:

$modification_time = (stat($file))[9]; # seconds since epoch
$time = time;  # now
$age = $time - $modification_time; # age in seconds

Gary

 -Original Message-
 From: Scott Burks [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, March 28, 2002 11:56 AM
 To: [EMAIL PROTECTED]
 Subject: Find Files Based on Age
 
 
 This might be simple, but I haven't found a solution yet.  I have a
 script that I use on our Unix boxes that uses 'find' to get a list of
 files in a certain directory that are a certain number of days old and
 removes them from the system (find / -name * -mtime +45 -exec rm -rf {}
 \;).  I need to port this to a Windows 2000 Server (he shudders as he
 says this) and haven't been able to find a command or module that will
 do the same search based on the age of the file.  Can anyone clue me
 into some Windows magic please.
 
 Scott Burks
 Systems Administrator
 Trust Company of America
 
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]