http://qs321.pair.com?node_id=602178


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?

Replies are listed 'Best First'.
Re^3: How do I find and delete files based on age?
by TGI (Parson) 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

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