Re: A way to recover deleted files (just contents) from USF2

From: Brian F. Feldman <green_at_freebsd.org>
Date: Tue, 20 Apr 2004 11:57:37 -0400
Xin LI <delphij_at_frontfree.net> 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_at_FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\
Received on Tue Apr 20 2004 - 06:57:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:51 UTC