From owner-freebsd-questions@FreeBSD.ORG Sun May 6 04:34:59 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47FF116A402 for ; Sun, 6 May 2007 04:34:57 +0000 (UTC) (envelope-from ray@stilltech.net) Received: from mail.geekdelivery.com (s205-206-56-226.ab.hsia.telus.net [205.206.56.226]) by mx1.freebsd.org (Postfix) with ESMTP id 0D5CE13C45A for ; Sun, 6 May 2007 04:34:56 +0000 (UTC) (envelope-from ray@stilltech.net) Received: from [192.168.0.102] ([70.65.134.12]) by media32.ca (mail.geekdelivery.com) (MDaemon.PRO.v8.1.3.R) with ESMTP id md50000066896.msg for ; Sat, 05 May 2007 22:32:14 -0600 From: Ray To: freebsd-questions@freebsd.org Date: Sat, 5 May 2007 22:34:28 -0600 User-Agent: KMail/1.9.5 References: <200705051705.43504.ray@stilltech.net> <463D2B0C.2030603@u.washington.edu> <20070506032313.GA6098@glitch.rwxrwxrwx.net> In-Reply-To: <20070506032313.GA6098@glitch.rwxrwxrwx.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705052234.29984.ray@stilltech.net> X-Spam-Processed: mail.geekdelivery.com, Sat, 05 May 2007 22:32:14 -0600 (not processed: message from valid local sender) X-MDRemoteIP: 70.65.134.12 X-Return-Path: ray@stilltech.net X-MDaemon-Deliver-To: freebsd-questions@freebsd.org X-MDAV-Processed: mail.geekdelivery.com, Sat, 05 May 2007 22:32:14 -0600 Subject: Re: disaster recovery - did I do the right thing? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ray@stilltech.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2007 04:34:59 -0000 On Saturday 05 May 2007 9:23 pm, Martin Tournoij wrote: > On Sat 05 May 2007 18:05, Garrett Cooper wrote: > > Martin Tournoij wrote: > > >On Sat 05 May 2007 17:05, Ray wrote: > > >>Hello all, > > >>I did something stupid the other day (sleep deprivation combined with a > > >> "clever" hack were the main reasons), and I'm just curious if I did > > >> the right thing afterwards. > > >> > > >>The mistake: > > >>/usr/local/# rm -f * > > >>note that root was running bash as a shell at the time, found in > > >> /usr/local/bin or something. > > >> > > >>What I did was to start over, reinstall from scratch. > > >>my question, was there an easier way? > > >>thanks, > > >>Ray > > > > > >You can use pkg_info -ga to check for missing files in your packages. > > > > For (t)csh: > > alias rm "rm -i" > > > > For (ba)sh: > > alias rm="rm -i" > > > > Now that you've learned :). > > > > Martin's suggestion is good though -- would have done that considering > > that all that lived in /usr/local were ports. > > > > -Garrett > Thanks, I'll keep that in mind, but there had better not be a next time. (anybody have a source for one of those nice white jackets with the really long sleeves, just in case? ;) ) > The problem with this is that it will ask confirmation for every file it > deleted. > Which is gets pretty annoying after a while, also, if you delete a > directory containing a 100 files, you will have to press 'y' a 100 > times. > This will probably lead to the habit of using 'rm -f', and/or simply > pressing y all the time without actually looking at the confirmation > message. > In any case, it's not likely to prevent any such accidents. > > A better solution would be to write a script that would move files > instead of deleting them. > You should name this script to something else than rm, when you're > working with a new or "foreign" system, you will expect rm to move > files, instead of deleting them ... and we can all see another > disaster coming there... > > Another hint would be the 'rmstar' option in tcsh, when set, tcsh will > ask confirmation before executing 'rm *'. > > Note that aliasing 'cp' and 'mv' to 'cp -i' and 'mv -i' is an > *extremely* wise idea, in the past I have often accidentally overwritten > files that should not have been overwritten, leading to various > problems. > good ideas, and I may use some of them, but wouldn't have helped in this case. I _wanted_ to erase all the files in this directory (I thought). Due to a softlink and name confusion (a "clever" hack) I wasn't in the directory I thought I was. You live, you learn. Ray >-- >Regards, >Martin Tournoij >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"