Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Delete Old Directories

by choroba (Chancellor)
on Oct 20, 2011 at 12:21 UTC ( #932641=note: print w/replies, xml ) Need Help??


in reply to Re^2: Delete Old Directories
in thread Delete Old Directories

Your date format is different from the proposed one. To make things easy, you should be using this one:
20110905 20111015 20111016 20111017 20111018 20111019 20111020
Then, just generate the string for the day 45 days ago and remove everything lesser.
How to find what that days' date was? How yould you proceed without a computer? Would you calculate the date, or just have a look into a calendar?

Replies are listed 'Best First'.
Re^4: Delete Old Directories
by Marshall (Monsignor) on Oct 24, 2011 at 06:08 UTC
    This is exactly the right idea! The file names shown will sort with a simple string comparison based upon the text from the file name. I am at a loss as to how to make this more clear.

    Working with the filename is just much easier and more obvious than working with OS specific things like the -M file test.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932641]
help
Chatterbox?
[stevieb]: man, when the roads are glare ice, I don't even bother going to work or out... unless I absolutely have to, or was already out in the first place
[choroba]: Tire chains are mandatory here in mountains, and the only unprepared each year are gritters
[stevieb]: I have a 3 day winter survival kit in my vehicle in the event I get snowed in in the mountains (which has happened before due to avalanches closing the roads (and once in the summer due to a massive forest fire that trapped us
[perldigious]: a handful of people in my work area did not make it, but I live pretty close and it's flat the whole way, so I didn't have any trouble. The roundabout is the worst thing I have to negotiate.
[thezip]: G'day all!
[perldigious]: Well, that and dodging the people who forget how ice works right away. :-)
[stevieb]: hey, thezip
[perldigious]: I don't miss having to drive up and down in elevation on roads that are iced over, I white knuckled gripping the steering wheel every time I had to where I used to live.
[perldigious]: So I don't envy you mountain guys if you have to drive in the winter, even with tire chains.
MidLifeXis waves.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2016-12-06 16:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (112 votes). Check out past polls.