From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 00DB415815E for ; Sat, 10 Feb 2024 15:56:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 54BADE2A08; Sat, 10 Feb 2024 15:56:29 +0000 (UTC) Received: from mail.muc.de (mail.muc.de [193.149.48.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9E649E29D7 for ; Sat, 10 Feb 2024 15:56:28 +0000 (UTC) Received: (qmail 88778 invoked by uid 3782); 10 Feb 2024 16:56:25 +0100 Received: from acm.muc.de (p4fe15cef.dip0.t-ipconnect.de [79.225.92.239]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 10 Feb 2024 16:56:25 +0100 Received: (qmail 1955 invoked by uid 1000); 10 Feb 2024 15:56:25 -0000 Date: Sat, 10 Feb 2024 15:56:25 +0000 To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] Don't be like stupid me! Message-ID: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Archives-Salt: 5507f458-1f21-47dd-992f-f9f4d8331a1d X-Archives-Hash: 702af291bc8fa2d04642f207ef351f44 Hello, gentoo. I was wanting to do a pretty full build of my Emacs working repository. This involved first purging al *.elc files. The way to do this is $ find . -name '*.elc' | xargs rm .. But for some reason, I typed $ find . '*.elc' | xargs rm .. I even carefully checked it before pressing RET. However, press it I did, instantly deleting all files in my working directory. OUTCH! So, I fell back on my backup from last Sunday. After about 1½ hours trial and error, I had my source files as of last Sunday back again, though git could have been more helpful than it actually is. Thankfully, I had Emacs open, with all the files modified since Sunday in buffers. So, I laboriously worked through Emacs's buffer list, saving those ones I'd since changed. I lost all my timestamps on the files, and lost all my Emacs backup files (things ending in ~ which Emacs constantly makes). But my software builds and runs. It could have been a lot worse. Boys and girls, don't use $ find .... | xargs rm unless you really know what you're doing. And even then, it's probably better not to. ;-( It occurred to me fairly quickly after that press of RET that I could have done well with a COW snapshot facility, something which has been discussed at length on another recent thread. I even have LVM on my machine for its RAID capabilities. But I've never bothered before. I mean "I'm too careful", amn't I? ;-( At least I do a weekly backup, though. So, in the end I managed to recover fairly well, thankfully. -- Alan Mackenzie (Nuremberg, Germany).