On Thu, 2006-22-06 at 16:45 +0800, Khairul Azmi wrote:
> Hi all,
> I have this problem. There is a script that stores log files into folders
> that follows structure of the following
> 
> YYYY/MM/DD
> 
> eg..
> 
> /var/log/projects/2006/06/20/8231.tgz
> /var/log/project1/2006/06/21/1432.tgz
> /var/log/projects/2006/06/22/1756.tgz
> /var/log/projects/2006/06/23/1756.tgz
> 
> Now I want to write a script that would erase all logs that has been stored
> except for the log for the current day. For the above example, since today
> is 23 June 2006, the code will erase log files in folders 2006/06/20/ and
> 2006/06/21/ only. Can somebody give ideas on how to do this. This script is
> to be ran once a day.
> 
> Thanks in advance.
> 
> mie

The module File::Find comes with Perl. See `perldoc File::Find` for
details.

-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



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


Reply via email to