Amanda-Users

Re: (repost) 2.5.1: underscores in diskname and index files

2007-03-02 09:15:23
Subject: Re: (repost) 2.5.1: underscores in diskname and index files
From: Paul Bijnens <Paul.Bijnens AT xplanation DOT com>
To: Amanda List <amanda-users AT amanda DOT org>
Date: Fri, 02 Mar 2007 15:07:51 +0100
On 2007-03-01 20:47, jeffrey d anderson wrote:
> On Friday 23 February 2007, Jean-Louis Martineau wrote:
>> This problem is fixed.
>> It will use single '_' it it exist, or double '__' if it exist.
>> If none exist, it will create with a single '_'.
>>
>> Jean-louis
>>
>> Jean-Francois Malouin wrote:
>>> Hi,
>>>
>>> I can't seem to find any info on that post I made a while ago
>>> and if any provisions have been made to fix it in 2.5.1p3:
>>> The ChangeLog is not specific if this issue has been fixed:
>>>
>>> It's about diskname containing underscores '_' that under 2.4.x
>>> lead to the creation of index files with the '_' doubled, ie for
>>> a DLE like (say):
>>>
>>> myhost home_user /home/user {
>>> tar-me-please
>>> }
>>>
>>> the index files would be stuffed in dir $INDEXDIR/myhost/home__user
>>>
>>> With 2.5.x would amcheck complains (really just a warning) that the
>>> index dir $INDEXDIR/myhost/home_user doesn't not exist and would be
>>> created on the next run. Same applies to info files. This is obviously
>>> a minor issue but could potentially confuse amanda newbies in the
>>> event that a recover session is required before a full dumpcycle is
>>> completed after the upgrade. OK, I'm lazy, all if have to do is write
>>> a little shell script :)
>>>
>>> regards,
>>> jf
> 
> I just upgraded my server to amanda 2.5.1p3.  I have two DLEs whose labels 
> include underscores, and both of them get the "index dir doesn't exist --will 
> create on next run" error.
> 
> For both of these DLEs amanda treated them as new disks, doing a level zero 
> that night, and new index directories were created with single underscores, 
> even though the old "double underscore" index directories existed.  This 
> wouldn't be a problem, except that now amrecover doesn't seem to be able to 
> find the old index files, saying that there are no indices for the dates 
> prior to the 2.5.1 upgrade.
> 
> I tried simply copying the old index files to the new, "single underscore" 
> directories, but this apparently is not sufficient. 
> 
> What do I need to do to be able to use amrecover on tapes made before the 
> 2.5.1 upgrade?
> 

I used a script to rename the directories and create a symlink
from the old name to the new name (so that i could fall back to the
older release if needed).

   for d in *__*
   do
       s=`echo $d | sed -e 's/__/_/g'`
       mv $d $s
       ln -s $s $d
   done

Apply this on each directory where amcheck would warn that
it will create a new tree (NOTE: both index and curinfo directories!)

old behaviour:   change '_' to '__', change '/' to '_'
new behaviour:   change '/' to '_'


As a side note: even with the old notation you could not unambigously
reconstruct the DLE name with slashes:
Both "/space/some_/dir" and "/space/some/_dir" mapped to
"_space_some___dir".
Moreover, accented letters in filenames still are tricky. The disklist
file should stricktly speaking be handled as a binary file, not a text
file: the filenames the file system can contain anything but a slash
or ascii-null; it just happens that when your terminal is utf8, that the
filenames created are a valid utf8 sequence.
Maybe it was better to encode any "dangerous" byte in the disklist
with e.g. some %+hex notation '%xx' (including spaces, braces, slashes,
any control-char any byte having the 8th bit set, etc).  Maybe
an idea for a future upgrade?  (the impact is not that large, because
the presence of a percent char in a path used for a DLE is even less
frequent than an underscore, which many people used to force some
order on the ls-command, putting an underscores before the 'a')


-- 
Paul Bijnens, xplanation Technology Services        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, *
* init 0, 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>