Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: How do I find and delete files based on age?

by exussum0 (Vicar)
on Feb 26, 2007 at 17:32 UTC ( #602178=note: print w/ replies, xml ) Need Help??


in reply to Re: How do I find and delete files based on age?
in thread How do I find and delete files based on age?

Touching on what was replied to you, I'd suggest replacing "rm -rf $_" with "echo rm -rf $_" At least then you can audit it until it works perfectly. ^^


Comment on Re^2: How do I find and delete files based on age?
Re^3: How do I find and delete files based on age?
by Moron (Curate) on Feb 26, 2007 at 17:47 UTC
    Yes, that I do agree with. And "print" if its not a shell-out. I also quite often put an echo in front of the perl -e (update: for long or multiple lines being typed in) to check that I typed what I think I typed before actually running it.

    -M

    Free your mind

Re^3: How do I find and delete files based on age?
by TGI (Vicar) on Feb 26, 2007 at 20:51 UTC

    I don't count myself as a newbie, but I always do a test like you suggest (print plain output) before unleashing a deletion script on my system--even if it's just a script to clean out a temp directory.

    It only takes a moment to make sure that you will be deleting what you think you will be deleting, and it is easily worth the time. How long will it take you to restore your files from backup? You have do backups, right?


    TGI says moo

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-07-30 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls