From owner-freebsd-current@FreeBSD.ORG Tue Apr 20 08:57:38 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id AA12A16A4CE; Tue, 20 Apr 2004 08:57:38 -0700 (PDT) Received: from localhost (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i3KFvbhQ050153; Tue, 20 Apr 2004 11:57:38 -0400 (EDT) (envelope-from green@green.homeunix.org) Message-Id: <200404201557.i3KFvbhQ050153@green.homeunix.org> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: Xin LI In-Reply-To: Message from Xin LI <20040420150916.GA1535@frontfree.net> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 20 Apr 2004 11:57:37 -0400 Sender: green@green.homeunix.org cc: current@freebsd.org cc: Daniel Lang Subject: Re: A way to recover deleted files (just contents) from USF2 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 15:57:39 -0000 Xin LI wrote: > On Tue, Apr 20, 2004 at 03:08:03PM +0200, Daniel Lang wrote: > [...] > > simple solution: > > > > alias rm="rm -i" > [...] > > If memory serves me right, a distribution of Linux does this aliasing > for root by default. Personally I prefer FreeBSD's approach beacuse, > when doing this type of things, we are potentially breaking semantics > of the original utility and hence may make errors on ther systems. > > A possible solution might be have a cron script that periodically > takes snapshot of the file system (for example, one per one hour). > While snapshot alone could be considered to be a complete backup > solution, it is possible to save our time when recovering files > from earlier snapshots, and it will be even possible to retrieve > earlier versions of files. However, the overhead when taking the > snapshots is not so neglectable (for a large file system, it will > take several seconds for a snapshot to be taken). > > This approach is more similiar with Windows's recycle bin approach, > but does not help in the download-and-rm case if there's no snapshot > taken between download and rm. That sounds like a cool idea. Maybe you could write a small program to do that and an rc.d script for it? Simplest operation would be something like: periodic_ufs_snap_enable="YES" periodic_ufs_snap_filesystems="/home" periodic_ufs_snap_interval="1h" periodic_ufs_snap_amount="2" The program would rotate snapshots every time period and delete them after whatever rotation amount. It wouldn't have to be more than some shell scripts that modify the system crontab if you want to do that instead of a separate daemon. It wouldn't be useful for everyone but having a very cheap "instant backup" would certainly be nice for those slap-your-forehead moments. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\