From owner-freebsd-questions@FreeBSD.ORG Tue May 8 05:17:11 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 59C1316A401 for ; Tue, 8 May 2007 05:17:11 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from gaia.nimnet.asn.au (nimbin.lnk.telstra.net [139.130.45.143]) by mx1.freebsd.org (Postfix) with ESMTP id DFB3413C455 for ; Tue, 8 May 2007 05:17:09 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (smithi@localhost) by gaia.nimnet.asn.au (8.8.8/8.8.8R1.5) with SMTP id PAA17251; Tue, 8 May 2007 15:16:38 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Tue, 8 May 2007 15:16:37 +1000 (EST) From: Ian Smith To: Ray In-Reply-To: <20070506120024.E412016A406@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org Subject: Re: disaster recovery - did I do the right thing? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2007 05:17:11 -0000 On Sat, 5 May 2007 17:05:42 -0600 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? Ray, I've been watching this thread, and you've had some good advice about backups etc, but if you really did 'rm -f *' in /usr/local (NOT 'rm -rf *') then it's very likely that you deleted no files at all. paqi% ll -rt /usr/local total 134 drwxr-xr-x 3 root wheel 512 Feb 9 2006 VFS -rw-r--r-- 1 root wheel 0 Aug 27 2006 moved_portsnap_from_var_db drwxr-xr-x 3 root wheel 512 Dec 3 22:31 src drwxr-xr-x 8 root wheel 512 Dec 10 17:17 www drwxr-xr-x 7 root wheel 512 Dec 10 19:34 libdata drwxr-xr-x 2 root wheel 512 Dec 10 19:52 build-1 drwxr-xr-x 9 root wheel 512 Dec 10 21:59 libexec drwxr-xr-x 2 root wheel 512 Dec 10 22:14 env drwxr-xr-x 2 root wheel 2048 Dec 10 22:53 info drwxr-xr-x 6 root wheel 512 Dec 10 23:23 gnu-autotools drwxr-xr-x 7 root wheel 512 Dec 27 16:33 diablo-jre1.5.0 drwxr-xr-x 3 root wheel 25088 Jan 28 01:36 bin drwxr-xr-x 83 root wheel 1536 Feb 11 22:37 share drwxr-xr-x 139 root wheel 24064 Feb 12 18:35 include drwxr-xr-x 33 root wheel 55296 Feb 12 18:35 lib drwxr-xr-x 27 root wheel 1536 Feb 12 18:38 etc drwxr-xr-x 2 root wheel 1024 Mar 3 20:53 sbin drwxr-xr-x 3 root wheel 512 Mar 29 23:20 portsnap drwxr-xr-x 28 root wheel 1024 May 5 04:22 man The only file 'rm -f *' in /usr/local would remove here is a comment I made for myself with 'touch moved_portsnap_from_var_db'; 'rm *' (with or without -f) does not remove directories (unless you also use -r). I can't say what was in _your_ /usr/local, but I've just checked on 4.8, 4.10, 5.5-STABLE and 6.1-RELEASE systems, and none of them install plain files in /usr/local at all, just directories. So you may be lucky .. Cheers, Ian