Re: needed tapes

"Stefan G. Weichinger via Bacula-users" <[email protected]>
Newsgroups gmane.comp.bacula.user
Message-ID <[email protected]>
ok, I now have:

# cat bacula_tapes.sh
#!/bin/bash

echo -e "sql\nSELECT Media.MediaId, Media.VolumeName, Media.PoolId, 
Pool.Name AS Pool, Media.Slot,\
         Media.Slot <> 0 AS InChanger, Media.FirstWritten, 
Media.LastWritten, Media.VolStatus, \
         GREATEST(0, (extract('epoch' from LastWritten + 
Media.VolRetention * interval '1second' - NOW())::bigint)) as ExpiresIn, \
         Media.VolBytes \
     FROM Media \
     INNER JOIN Pool \
         ON Media.PoolId = Pool.PoolId \
     ORDER BY Media.LastWritten;\n\nquit\n" | bconsole


Works. I am not compentent with these SQL-queries, I try to filter out 
only tapes for a specific Pool now.

Adding

"WHERE Media.Pool = Daily \"  after the FROM line for example doesn't work.

Would you help me out once more? I assume the WHERE conflicts with the 
JOIN or so ...

thanks a lot!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.