On Thu, Aug 4, 2011 at 3:27 PM, Rao, Uthra R. (GSFC-672.0)[ADNET
SYSTEMS INC] <uthra.r.rao AT nasa DOT gov> wrote:
> I am not sure how to run the query to get the information I am looking for.
> Any help is appreciated. I am running Posgresql on my server.
>
Although this is not the exact thing you want Here is query 17 from my
/etc/bacula/query.sql
# 17
:List Volumes Bacula thinks are full and in changer
SELECT MediaId,VolumeName,VolBytes/(1024*1024*1024) AS GB,Storage.Name
AS Storage,Slot,Pool.Name AS Pool,MediaType,Media.lastwritten,VolStatus
FROM Media,Pool,Storage
WHERE Media.PoolId=Pool.PoolId
AND Slot>0 AND InChanger=1
AND (VolStatus='Full' OR VolStatus='Archive')
AND Media.StorageId=Storage.StorageId
ORDER BY MediaType ASC, Media.lastwritten ASC;
This query lists the "Full" or "Archive" volumes that are in my
autochanger in order of lastwritten. Remember that recycling goes by
this lastwritten time.
Here is how I run this:
fileserv ~ # bconsole
Connecting to Director fileserver:9101
1000 OK: fileserver-dir Version: 5.0.3 (04 August 2010)
Enter a period to cancel a command.
*query
Automatically selected Catalog: HBCatalog
Using Catalog "HBCatalog"
Available queries:
1: List up to 20 places where a File is saved regardless of the directory
2: List where the most recent copies of a file are saved
3: List last 20 Full Backups for a Client
4: List all backups for a Client after a specified time
5: List all backups for a Client
6: List Volume Attributes for a selected Volume
7: List Volumes used by selected JobId
8: List Volumes to Restore All Files
9: List Pool Attributes for a selected Pool
10: List total files/bytes by Job
11: List total files/bytes by Volume
12: List Files for a selected JobId
13: List Jobs stored on a selected MediaId
14: List Jobs stored for a given Volume name
15: List Volumes Bacula thinks are in changer
16: List Volumes likely to need replacement from age or errors
17: List Volumes Bacula thinks are full and in changer
18: Get all the Jobids for a job
19: List Volumes by status
20: List where the most recent copies of folder
Choose a query (1-20): 17
+---------+------------+------+--------------+------+---------------------+-----------+---------------------+-----------+
| mediaid | volumename | gb | storage | slot | pool
| mediatype | lastwritten | volstatus |
+---------+------------+------+--------------+------+---------------------+-----------+---------------------+-----------+
| 285 | A00088 | 383 | DEV6-Changer | 20 |
LTO2-Archived-Data | LTO-2 | 2011-02-21 19:17:37 | Full |
| 286 | A00091 | 299 | DEV6-Changer | 22 |
LTO2-Archived-Data | LTO-2 | 2011-03-07 15:53:01 | Full |
| 287 | A00092 | 280 | DEV6-Changer | 23 |
LTO2-Archived-Data | LTO-2 | 2011-03-07 20:37:37 | Full |
| 260 | A00063 | 424 | DEV6-Changer | 3 |
LTO2-System-Backups | LTO-2 | 2011-06-02 20:25:18 | Full |
| 289 | A00093 | 412 | DEV6-Changer | 10 |
LTO2-Archived-Data | LTO-2 | 2011-06-08 19:29:01 | Full |
| 300 | A00105 | 299 | DEV6-Changer | 2 |
LTO2-Archived-Data | LTO-2 | 2011-06-17 18:21:08 | Full |
| 301 | A00103 | 260 | DEV6-Changer | 4 |
LTO2-Archived-Data | LTO-2 | 2011-07-26 17:44:20 | Full |
+---------+------------+------+--------------+------+---------------------+-----------+---------------------+-----------+
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
|