Amanda-Users

Re: DAMN! AN AMRECOVER DELETED ALL MY /ROOT CONTENTS!!!

2003-09-22 18:02:45
Subject: Re: DAMN! AN AMRECOVER DELETED ALL MY /ROOT CONTENTS!!!
From: Jay Lessert <jayl AT accelerant DOT net>
To: Bruno Negrão <bnegrao-amanda AT engepel.com DOT br>
Date: Mon, 22 Sep 2003 14:59:58 -0700
On Mon, Sep 22, 2003 at 05:38:18PM -0300, Bruno Negrão wrote:
> Paul, just to be precise, when I selected the files to be backed up, I
> issued an "add *" command. Since the * symbol doesn´t select any file
> beginning with an ".", I didn´t selected the "." directory! And if the "*"
> of amrecover includes files begining with a dot, it shouldn´t because it
> isn´t the standard!

Here's what's going on.

Doesn't have anything to do with what you select, or how.  It is simply
how amrecover calls GNU tar.

amrecover always(?) calls GNU tar with '-xpGvf'.  From the GNU tar
manual:

    --incremental (-G) in conjunction with --extract (--get, -x) causes
    tar to read the lists of directory contents previously stored in
    the archive, delete files in the file system that did not exist in
    their directories when the archive was created, and then extract
    the files in the archive.

So Paul is stretching it a bit when he says "it's tar, not amanda",
because it is amanda that throws the -G flag.  This is *exactly* the
behavior you must have do to an accurate full restore, of course,
which is why it is there.

> Also, was amanda that called tar this way, so I think it´s amanda´s fault.
> See, i couldn´t specify in any place what would be the tar options I wanted.

recover-src/extract_list.c (only semi-joking).

One of the dazzling beauties of amanda is that you *can* tweak and tune
it if you need to.  I admin both amanda and NT Backup Exec (for an
Exchange server), and I would KILL to get my hands on the source to
change some of the truly brain-damaged monkey-business that BE pulls.

> If amanda is a backup tool it shouldn´t act as a "destruction" tool any
> time! I think what happened to me can happen with anyone and this is a big
> risk, don´t you think?

You can always "shoot yourself in the foot" with *any* restore tool by
running in the wrong place at the wrong time.  If you think about it
for awhile, you realize that it is impossible to make this operation
risk-free.

> I sincerely think that amanda´s  developers must find a way completely avoid
> this risk.

I do not think that is possible.  You can kill yourself just as
completely with an over-write as a remove, for example.

It *might* be useful to modify amrecover and it's man page to be
a little more complete and self-consistent:

1)  amrecover never calls *dump with the r flag, and always calls
    GNU tar with the -G flag.

    It might be useful if this was at least documented in the man page,
    so that one knows when one must use amrestore instead of
    amrecover.

2)  It would certainly be possible to add user flags to amrecover to
    control "dump r" and "tar -G"; I don't have any suggestions on how
    to do this in a way that is coherent and understandable, though.
    :-)

-- 
Jay Lessert                               jay_lessert AT accelerant DOT net
Accelerant Networks Inc.                       (voice)1.503.439.3461
Beaverton OR, USA                                (fax)1.503.466.9472