[Gllug] Undelete...?
Ian Norton
bredroll at darkspace.org.uk
Sat Feb 7 13:08:41 UTC 2004
On Thu, Feb 05, 2004 at 03:21:09PM +0000, Daniel P. Berrange wrote:
> On Thu, Feb 05, 2004 at 02:13:49PM -0000, Kristian Davies wrote:
> > mdk 7
> >
> > I had a directory with a couple of files starting with "?blah"
> > So like a Burk I deleted them with "rm -fr ?*" ... Don't laugh!
> >
> > Well anyway, in that directory was a script I use all the time, which I
> > would rather no rewrite.
> >
> > Is there a way of getting my file back?
> >
> > I realise this is a total newb question, but I find it hard to believe there
> > is no way of recovering a file which has not been overwritten.
>
> There are various levels of protection you can use, by setting up
> command aliases. For example, as root, always have
>
> alias rm="rm -i"
> alias mv="mv -i"
> alias cp="cp -i"
>
> Of course, since you supplied '-f' that wouldn't help.
>
> So for even greater protection alias 'rm' to instead do a copy with
> backups:
>
> function rm {
> if [ ! -d ~/.trash ]; then
> mkdir ~/.trash
> fi
>
> mv --backup=numbered $@ ~/.trash
> }
>
> So instead of deleteing the files, 'rm' now simply moves them
> to the trash directory, renaming any files already there with
> ever increasing numbered suffixing.
>
> Or just use a GUI file manager like Nautilus instead of the shell.
>
> For networked storage, the AFS filesystem can be configured to take
> a daily file system snapshot &make that available, at ~/.yesterday
>
> Dan.
:-) i should read ahead before posting ;-)
Ian
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list