By the way, as already seen in another post, bacula 11 will merge the
filename table to the file table so the problem for new backups could
be allready fixed in this version !?

Am 14.06.21 um 11:43 schrieb Pierre Bernhardt:
> Am 14.06.21 um 09:15 schrieb Pierre Bernhardt:
>> I have a bunch of other filenames which are duplicated in filename
>> table found. I found also some duplicate names in path table.
>> Did I have forgotten any thing?
>>
>> I fixed it by python script one step by next but this should not be
>> the best solution.

At first, the problem could be allready exists after I recover my
database after a bscan of all my tapes very long time ago. It was
not registred by me because I didn't found a problem before, but
I had never checked the recovers in detail. The files which have
a duplicate row in filename table and also in file table will be
recover but they will have only the wrong permissions and user:
group also timestamp.

Here the steps to identify and fix the issue:

select count(name) as amount, name from filename group by name having 
count(name) > 1;

All lines found here have exactly 2 rows in filename table, so
I want to remove the one with older filenameid. This means I must
check that in file table for each job the newer filenameid exists and the
older one could be removed.
There two solutions:

1. update all older filenameid in file table by the new filenameid
2. remove all duplicate entries in the file table
3. remove older filenameid entries in the filename table.

This is more complex because they could exists file entries which use
same filenameid but different pathes and/or fileindex.

1. remove all older filenameid in file table where newer filenameid row is a 
duplicate
2. update all older filenameid in file table which is not a duplicate
3. remove older filenameid entries in the filename table

This is better because it does not produce duplicate entries which must
identify before removed them.

By the way I'm novice to produce such sql queries. So better to use
the select statement above and use python to produce a delete clause
which remove all of them :-/

Cheers,
Pierre



_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to