Hi all, have found an fix for my problem :-)
Because the JobId in the Job table is auto_increment, it was able to add an ORDER BY JobId ASC in the sql_cmds.c Here it is: diff -u src/cats/sql_cmds.c_old src/cats/sql_cmds.c --- src/cats/sql_cmds.c_old 2008-01-21 13:26:03.000000000 +0100 +++ src/cats/sql_cmds.c 2008-01-21 13:26:28.000000000 +0100 @@ -493,4 +493,4 @@ /* Query to get list of files from table -- presuably built by an external program */ const char *uar_jobid_fileindex_from_table = - "SELECT JobId,FileIndex from %s"; + "SELECT JobId,FileIndex from %s ORDER BY JobId ASC"; Greetings, Daniel Daniel Betz wrote: > Hi all, > > i have an problem with restoring files from an filelist in an database. > > the best is, that i will explain this in an example: > > I use bacula 2.2.6 on over 110 backup servers an on over 1200 clients. > To easy control restores (6-10 restores every day) i have written an > perl script to search in the bacula databases for files and to restore them. > The script searches for path an filename and returns the File.JobId and > File.FileIndex and pushes it into an temporary database. > Then i use the command-line restore command to restore the files: > restore client="clientname" file=?temporary-databasename > > Now to the problem itself. > > When i have an Incremental Job -> Jobid 2 and an Full Job -> Jobid 1 and > an File called testfile.txt who changes every day, it is existent in all > two backups. > Now i write the Database: > CREATE TABLE `Restore_866` ( > `JobId` VARCHAR( 255 ) NOT NULL , > `FileIndex` VARCHAR( 255 ) NOT NULL , > INDEX ( `FileIndex` ) > ) ENGINE = MYISAM ; > INSERT INTO Restore_866 VALUES(2, 1234112); # (testfile.txt from newer > incremental backup) > INSERT INTO Restore_866 VALUES(1, 2134123); # (testfile.txt from older > full backup) > > When i do the restore, it will restore the file from the older full > backup and not from the incremental one. > > Is there an way to say bacula, that he must restore the file from the > latest backup an not to overwrite it from the older backup ? > > I hope you know what i mean :-)) > > Greetings, > Daniel > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Bacula-users mailing list > Bacula-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bacula-users > -- Freundliche Grüße Daniel Betz Technical Support ___________________________________ domainfactory GmbH Oskar-Messter-Str. 33 85737 Ismaning Germany Telefon: +49 (0)89 / 55266-364 Telefax: +49 (0)89 / 55266-222 E-Mail: [EMAIL PROTECTED] Internet: www.df.eu Registergericht: Amtsgericht München HRB 150294, Geschäftsführer Tobias Marburg, Jochen Tuchbreiter ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users