[ale] deleting old files

Jonathan Rickman jonathan at xcorps.net
Wed May 23 22:20:06 EDT 2001


find / -atime +100 -exec rm -i "{}" ";"

That might be a better idea...(note the "-i")

-- 
Jonathan Rickman
X Corps Security
http://www.xcorps.net

On Tue, 22 May 2001, Stephen F Nicholas wrote:

> OK,
> As having been bitten by this command, my suggestion is to exec the 'ls'
> command, rather than the 'rm' command first.  If you like what you see,
> change the ls command to rm.  In the ksh shell, set -o vi works really
> nice. Then do a ^k to retrieve the prevoius command.  You can use the vi
> commands to edit the line..
>
> This information comes to you after I had to do a 24GB recover from tape
> with a command gone bad :-(
>
> Test first...Production later
>
> Steve
>
> =======================================================
> | Steve Nicholas             |                        |
> | Unix System Programmer     |  A risk is not a risk  |
> | Georgia State University   |  until it is taken.    |
> | snicholas at gsu.edu          |                        |
> | 404-651-1062               |  BBROYGBVGW            |
> =======================================================
>
> On Tue, 22 May 2001, Glenn C. Lasher Jr. wrote:
>
> >
> >
> > This syntax is correct.  Also, a slight variation:
> > find / -atime +100 -exec rm {} \;
> >
> > ...really boils down to the same thing.
> >
> > * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
> >
> > THIS COMMAND IS VERY DANGEROUS!  I EXECUTED A VARIATION OF THIS IN A USER
> > SPACE ON A SERVER AT WORK (using gzip rather than rm) AND IT TARGETTED AN
> > EXECUTABLE THAT WAS ONLY NEEDED AT BOOT TIME.  SINCE THIS SERVER WAS
> > SEVERAL MONTHS BETWEEN BOOTS, IT WASN'T NOTICED TO BE MISSING FOR SOME
> > TIME.  Fortunately, it was just vncpasswd, so it could be fairly easily
> > replaced after booting, but it can be much worse.
> >
> > * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
> >
> >
> >
> > On Tue, 22 May 2001, Jason Lynn wrote:
> >
> > > You could use the find command... though I think this would be a dangerous
> > > thing to do.
> > >
> > > find / -atime +100 -exec rm -f "{}" ";"
> > >
> > > You might check my syntax (and logic) for the above command before executing
> > > it.  ;)
> > >
> > > Jason
> > >
> > >
> > > >From: "Christopher Bergeron" <christopher at bergeron.com>
> > > >To: <ale at ale.org>
> > > >Subject: [ale] deleting old files
> > > >Date: Tue, 22 May 2001 16:16:42 -0400
> > > >MIME-Version: 1.0
> > > >Received: from [130.205.99.162] by hotmail.com (3.2) with ESMTP id
> > > >MHotMailBCD413F300CB4004321282CD63A266800; Tue May 22 13:15:48 2001
> > > >Received: (qmail 1297 invoked by alias); 22 May 2001 20:29:22 -0000
> > > >Received: (qmail 1294 invoked by uid 30); 22 May 2001 20:29:21 -0000
> > > >Received: (qmail 1289 invoked from network); 22 May 2001 20:29:20 -0000
> > > >Received: from c000-h008.c000.snv.cp.net (HELO c000.snv.cp.net)
> > > >(209.228.32.72)  by 130.205.99.162 with SMTP; 22 May 2001 20:29:20 -0000
> > > >Received: (cpmta 18163 invoked from network); 22 May 2001 13:12:12 -0700
> > > >Received: from unknown (HELO mispc4) (12.127.170.98)  by smtp.bergeron.com
> > > >(209.228.32.72) with SMTP; 22 May 2001 13:12:12 -0700
> > > >From owner-ale at ale.org Tue May 22 13:17:05 2001
> > > >Delivered-To: ale-outgoing at ale.org
> > > >X-Sent: 22 May 2001 20:12:12 GMT
> > > >Message-ID: <OKEBLBBHLBDKEOLMJFNICELPCBAA.christopher at bergeron.com>
> > > >X-Priority: 3 (Normal)
> > > >X-MSMail-Priority: Normal
> > > >X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
> > > >Importance: Normal
> > > >X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
> > > >Sender: owner-ale at ale.org
> > > >Precedence: bulk
> > > >
> > > >If I have a machine that has been mastered and is "production ready", can I
> > > >issue a command to wipe out all the files that haven't been accessed in a
> > > >while?  Specifically, I want to make an embedded system, so I want my disk
> > > >usage to be as small as possible.  When I have everything I'm going to need
> > > >on the machine, I want to issue a command to "delete all files not
> > > >accessed/modified since: xxxx".  Can I do this?  Can anyone think of
> > > >something I may have overlooked before I do this?
> > > >
> > > >Thanks in advance...
> > > >
> > > >--
> > > >To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message
> > > >body.
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at http://explorer.msn.com
> > >
> > > --
> > > To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
> > >
> >
> > --
> > glasher at nycap.rr.com
> > After 163 days, Verizon still couln't deliver Telocity DSL.
> >
> > --
> > To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
> >
>
> --
> To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
>


--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list