Amanda-Users

Re: [newbie] backup only 2 or 3 type of files

2003-07-02 10:02:08
Subject: Re: [newbie] backup only 2 or 3 type of files
From: Paul Bijnens <paul.bijnens AT xplanation DOT com>
To: Bernard MAYER <netman.qos AT free DOT fr>
Date: Wed, 02 Jul 2003 15:59:40 +0200
Bernard MAYER wrote:
But, your answer push a new question : What are a wrapper ? and how to
use this in our case ?

A wrapper is a program that you execute instead of the real program.
The purpose is to fiddle a little with the normal behaviour before
starting the real program (or fiddle after it).

The normal way to do this is to compile amanda to use your special
program as "gnutar" with:

        ./configure --prefix=... --with-gnutar=/usr/local/bin/amgtar

The program "amgtar" can be a simple link to the real gnutar:

        ln -s /bin/tar  /usr/local/bin/amgtar

(in the case the "/bin/tar --version" says it is 1.13.25 or better)
Or it could be a little shell script:

        #!/bin/sh

        /bin/tar "$@"

So now we have our little shell script and we will adapt it for our
purpose:  if the directory is /my/project than we have to generate
the amanda-include-only list first:

        #!/bin/sh
        
        case "$*" in
            *'--directory /my/project '*)
                cd /my/project
                find . -xdev \( \
                        -name '*.xml' \
                    -o  -name '*.pl' \
                    \) -print > amanda-include-only
                ;;
        esac

        exec /the/real/bin/gnutar "$@"


!!! While writing this, I came to the conclusion that this
only works by accident.  The amanda client first constructs
an "include" list /tmp/amanda/*.include from all include
directives, and gives that filename as argument to --files-from.
By the time this wrapper gets a chance to update the
amanda-include-only file, the other file is already constructed.
But because amanda first runs an estimate phase (up to three:
level 0, level n, level n+1) the amanda-include-only file is filled
correctly by the time it runs the real backup.
This means that the estimate for level 0 could be completely
wrong.  If this is a problem, create the amanda-include-only file
the file-list in an independant program a few minutes before the real
amdump runs.

!!  While writing the above paragraph, I see you could get smarter
and replace the --file-from with something you construct here
on the fly too.

I'll stop thinking here, or I never get this mail sent.  :-)

--
Paul Bijnens, Xplanation                            Tel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM    Fax  +32 16 397.512
http://www.xplanation.com/          email:  Paul.Bijnens AT xplanation DOT com
***********************************************************************
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, F6, *
* quit,  ZZ, :q, :q!,  M-Z, ^X^C,  logoff, logout, close, bye,  /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* kill -9 1,  Alt-F4,  Ctrl-Alt-Del,  AltGr-NumLock,  Stop-A,  ...    *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
***********************************************************************



<Prev in Thread] Current Thread [Next in Thread>