[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: undelete



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You could probably write a perl or python script (call it "safe_rm")
that traps the input parameters and does a fancy mv, echoing the
fully qualified file name into either ~/.trash (if run by an
unprivileged user, or /trash if by root.

Sadly, this will only save files that you delete from the CLI.  To
be universal, such a trash feature would have to be implemented
either in the OS (a highly unlikely prospect) or within the libc
ulink() function.  (Also highly unlikely, but much more portable
than changing every OS that libc runs on.)

On 01/23/07 12:44, Tony Heal wrote:
> OK, how about some preventative stuff. If there is not real way to
> 'undelete' files. How about adding a script named 'rm' that passes the same
> switches to from the script to /bin/rm but moves the files to tmp before
> deleting them.
> 
> Anyone have something like this hanging around their system somewhere?
> 
> Tony
> 
> -----Original Message-----
> From: Ron Johnson [mailto:ron.l.johnson@cox.net] 
> Sent: Tuesday, January 23, 2007 12:34 PM
> To: debian-user@lists.debian.org
> Subject: Re: undelete
> 
> On 01/23/07 10:37, Tony Heal wrote:
>> Is there a way to recover deleted files?
> 
> Maybe, if you are using FAT (highly unlikely) or ext2 (also highly
> unlikely) and you pulled the plug as soon as you noticed what you did.
> 
> Sadly, the standard answer, though, is, "No, you're SOL."
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFtmH5S9HxQb37XmcRArgjAJ9j32V43WpcgQRy8/L/lu3RdaAjbACfWtW5
RCP8vph0/rrqE9RgUkD1PFY=
=l8Q0
-----END PGP SIGNATURE-----



Reply to: