I pretty much ignore my tape library. It asks for tapes when it runs out. However, I think I should be looking ahead and anticipating requests. Thus, I came up with this SQL query:
[dan@ngaio:~] $ psql bacula
psql (8.4.5)
Type "help" for help.
bacula=#
SELECT mediaid, volumename, volstatus, slot, inchanger, pool.name, volbytes
FROM media, pool
WHERE media.poolid = pool.poolid
AND volumename LIKE 'ETU0%'
AND inchanger != 0
ORDER BY slot;
mediaid | volumename | volstatus | slot | inchanger | name | volbytes
---------+------------+-----------+------+-----------+---------------+-------------
1328 | ETU021 | Append | 1 | 1 | Differentials | 64512
1316 | ETU020 | Append | 2 | 1 | Differentials | 9645189120
1440 | ETU032 | Full | 3 | 1 | Incrementals | 74433429504
1441 | ETU033 | Append | 4 | 1 | Incrementals | 47176528896
1286 | ETU002 | Append | 5 | 1 | Fulls | 64512
1284 | ETU004 | Append | 6 | 1 | Fulls | 23292509184
1285 | ETU003 | Append | 7 | 1 | Fulls | 64512
1442 | ETU031 | Append | 9 | 1 | Incrementals | 64512
(8 rows)
bacula=#
With this, I can see that what tapes are full, and then decide what to swap out and replace with refresh tapes.











