Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: del files that is 7 days or older

by dvergin (Monsignor)
on Feb 15, 2001 at 00:21 UTC ( #58439=note: print w/replies, xml ) Need Help??


in reply to del files that is 7 days or older

First, let's format things a little so we can see more clearly what you are sharing with us. If you put your code between <code>...</code> tags, it will keep its alignment. Here's your code again:
#!/usr/bin/perl chdir('/home/archive/logs/old'); @FileNum = system("ls -t -al") ; chomp($month = 'date +"%b" --date "7 day ago"'); chomp($date = 'date +"%d" --date "7 day ago"'); foreach (@FileNum) { if /how do I compar the date?? here { system(" rm $_"); } };

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://58439]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2023-02-01 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (9 votes). Check out past polls.

    Notices?