Why not use mtx to figure out the tape status?
mtx -f /dev/sg1 status
  Storage Changer /dev/sg1:2 Drives, 48 Slots ( 0 Import/Export )
Data Transfer Element 0:Full (Storage Element 43 Loaded):VolumeTag =
JX2072L3                        
Data Transfer Element 1:Full (Storage Element 6 Loaded):VolumeTag =
AX7578L4                        
      Storage Element 1:Full :VolumeTag=AX7336L4                        
      Storage Element 2:Full :VolumeTag=AX7577L4                        
      Storage Element 3:Full :VolumeTag=AX7339L4                        
      Storage Element 4:Full :VolumeTag=AX7337L4                        
      Storage Element 5:Full :VolumeTag=AX7335L4                        
      Storage Element 6:Empty
      Storage Element 7:Full :VolumeTag=AX7320L4                        
      Storage Element 8:Full :VolumeTag=AX7328L4                        
      Storage Element 9:Full :VolumeTag=AX7329L4                        
      Storage Element
10:Full :VolumeTag=AX7576L4                        
      Storage Element 11:Full :VolumeTag=JX2050L3
....


                        -Jason

On Thu, 2008-02-07 at 16:49 -0500, John Stoffel wrote:
> >>>>> "Mark" == Mark Nienberg <[EMAIL PROTECTED]> writes:
> 
> Mark> John Stoffel wrote:
> Mark> John Stoffel wrote:
> >>>> even if you *don't care* which drive gets used, bacula should just
> >>>> pick it's own damm drive for the checking, if needed.  And since
> >>>> update slots hacks the Media table, what's the process to get the
> >>>> status without an update?
> >> 
> Mark> Does this give you what you need?
> >> 
> Mark> #!/bin/sh
> Mark> bconsole -c /etc/bacula/bconsole.conf <<END_OF_DATA
> Mark> query
> Mark> 15
> Mark> quit
> Mark> END_OF_DATA
> >> 
> >> Not really, since it doesn't show which tapes are in which drives (if
> >> in any).  I can already get this information from the DB using my
> >> script.  
> >> 
> >> I'm now looking for:
> >> 
> >> 1. Number of slots in jukebox
> >> 2. Which tape(s) are in which drive(s).
> 
> Mark> "status storage" is the only way I know to get bacula's opinion
> Mark> of what tape is in what drive.
> 
> Yeah, and bacula just seems to keep the drive status somewhere
> internally, but not in the DB where it could be queried externally.  
> 
> Mark> My changer came with a utility program that can output the slot
> Mark> occupants and the tape drive status.  Maybe you have something
> Mark> similar?  Otherwise mtx or the bacula mtx-changer script can do
> Mark> some of this.
> 
> Mark> The number of slots for example:
> Mark> /etc/bacula/mtx-changer /dev/sg0 slots
> 
> Sure, but I'm starting to think that it would be nice if the
> autochanger resource record included a record for the number of slots
> in a jukebox.  
> 
> And even a way to specify that a certain range of slots is to be only
> used for cleaning tapes.
> 
> Then, putting this info into the DB would be nice as well.  It's not
> like it changes often (relatively speaking) and again would let you
> query things better.
> 
> We already have a Devices table, just adding in an Autochanger table
> would be nice.  
> 
> John
> 
> -------------------------------------------------------------------------
> 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
-- 
----------------------------------------------------------------------------
Jason A. Kates ([EMAIL PROTECTED]) 
Fax:    208-975-1514
Phone:  212-400-1670 x2
============================================================================



-------------------------------------------------------------------------
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

Reply via email to