Re: [Bacula-users] Some files are not backup because of more than 1 filename exits in filename table?

2021-06-21 Thread Pierre Bernhardt
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


Re: [Bacula-users] Some files are not backup because of more than 1 filename exits in filename table?

2021-06-14 Thread 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.

I'm sorry for this mistake sentences. I fixed it only for two filename.
But there many more filename duplicates in the table and also for path
table which is not fixed, yet.
In my opinion this should not be a problem but it looks like the bacula
code does not make sure that only one, maybe latest line, will be used
to fill the file table at backup time, so two lines will be created.
This looks like a bug. Where it comes from? No idea. I use this catalog
long time (since more than 10 years, my oldest job is from 2008).

Cheers,
Pierre



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


[Bacula-users] Some files are not backup because of more than 1 filename exits in filename table?

2021-06-14 Thread Pierre Bernhardt
Hello,

I've found by a verify job that some files looks like not correctly backup.

So my filled /home/pierre/.screenrc is in the bconsole restore menu shown
as empty file with root:root owner instead pierre:pierre and have a 0 unix
epoche timestamp (1.1.70 1:00 am).

I found also a warning message found:

 Warning: sql_get.c:186 More than one Filename!: 2 for file: .screenrc

So i checked the filename table and found two filenameid for the same filename.
I checked also the file table and found two sets of files, one related to the
one filenameid and the other to the other filenameid but pathid, jobid, 
fileindex
and all other columns without fileid are the same. fileid differs also.

It looks like each backup for one file there will be created two new
lines in the file table.

By a test I removed the older filenameid entry, than I checked the file
table that there exists minimum two rows in the file table where jobid,
pathid and fileindex, one to the removed filenameid and one to the
newer one. For all of them I removed the rows related to the removed
filenameid. The rest of rows i update the filenameid to the newer one
(only one row was found).

After a checking the catalog and a restore test no error related to
this file is shown any more. The stats like permissions and timestamps
are now also fixed.

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.

Is there a tool which can fix such issue?

Cheers,
Pierre



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