Dear Developers

I have been receiving a lot of help from the Bacula-users list. However
there is one subject to which I haven't had any responses and I would be
grateful for your help.

I wish to create information to accompany each LT04 tape set I produce
on behalf of each of our clients. This is so that others can work out
how to retrieve information off the tapes in future.

I intend to produce the following files on CD or DVD to accompany each
tape set:

    * a text file with general information about the file set and Bacula
      and the bextract utility.
    * a Bacula bootstrap file for the tape set 
    * a text file dump of elements of the Catalog 

For this last item I wish to include the tape number on which each
listed file is included. (This is useful also for our auditing procedure
where we wish to pull back a file from each tape.)

However I cannot find how to do an SQL JOIN between Media and File and
JobMedia.FirstIndex (for instance) does not appear to point to
File.FileID.

Can someone point me to the relationship between Media and File?

Thanks
Rory

p.s. My query so far is

   SELECT 
        j.jobid, j.name AS jobname, jmlj.volumename, jmlj.slot, f.fileid,
        p.path, fn.name AS filename, f.md5
   FROM 
        job j, 
        filename fn, 
        path p, 
        file f
   LEFT JOIN 
          ( SELECT 
                jj.jobid, jj.mediaid, m.volumename, 
                m.slot, jj.firstindex, jj.lastindex
           FROM 
                jobmedia jj, media m
          WHERE 
                jj.mediaid = m.mediaid
          ) jmlj ON 
            jmlj.jobid = f.jobid 
            AND 
            f.fileid >= jmlj.firstindex  -- wrong!
            AND  
            f.fileid <= jmlj.lastindex   -- wrong!
   WHERE 
        f.jobid = j.jobid 
        AND 
        f.pathid = p.pathid 
        AND 
        f.filenameid = fn.filenameid;

-- 
Rory Campbell-Lange
r...@campbell-lange.net
egistered in England No. 04551928

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to