Amanda-Users

Re: flush full dumps only

2004-03-19 13:02:22
Subject: Re: flush full dumps only
From: Paul Bijnens <paul.bijnens AT xplanation DOT com>
To: Jonathan Dill <jfdill AT jfdill DOT com>
Date: Fri, 19 Mar 2004 18:59:20 +0100
Jonathan Dill wrote:

almost so simple as to be a joke, but I don't have any idea what kind of
bugs can be found.

See below :-)

------------------------------------------------------------------------

#!/bin/tcsh -f
set r=(/snap/amanda-hd)
set i=(/snap/amanda-incr)
cd $r
set dl=(`find . -depth -type d -print`)
cd $i
foreach d ($dl)
  if (! -d $d) then
    echo mkdir -p $d
  endif
end
cd $r
foreach d ($dl)
  set fl=(`find . -type f \! -name "*.0" -print`)
  foreach f ($fl)
    echo mv $f $i/$f
  end
end


The last "find" command is intended to get all but the level zero dumps, but it is not completely correct: Full dumps that were split into chunks have a dot + chunknumber appended after the level ".0".

I can't come up with a perfect solution, but the find below should work
fine if the chunks are not too small (if each filesystem is 100 chunks at most).

        find . -type f \! -name "*.0" \
                -a \! -name "*.0.[0-9]" \
                -a \! -name "*.0.[0-9][0-9]" \
                -print

at least if we don't have a DLE that ends in ".0", and where the
incremental backup would end in ".0.1".  :-(

ps. You could replace the first "find, mkdir" with:
        cd $r;
        find . -type d | cpio -pd $i
pps. If you don't mind flush the incrementals to tape too, the
script could be:

        cd $r
        find . -type f \! -name "*.0" \
                -a \! -name "*.0.[0-9]" \
                -a \! -name "*.0.[0-9][0-9]" \
                -print |
        tee /tmp/amanda/flushonly |
        cpio -pdml $i
        rm `cat /tmp/amanda/flushonly`

and you should avoid DLE's with confusing names...
        
--
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>