Thanks.  I've added your #17 and 18 to the query.sql file.


On Monday 16 January 2006 10:27, Arno Lehmann wrote:
> # 16
>
> :List last 25 Jobs ordered by start time with long status:
>
> SELECT JobId,Name,StartTime,Type,Level,JobFiles,JobBytes,JobStatusLong
> AS Status
> FROM Job
> LEFT JOIN Status ON Job.JobStatus=Status.JobStatus
> ORDER BY StartTime
> DESC
> LIMIT 25;
> # 17
>
> :List which media bacula thinks is in changer:
>
> SELECT MediaId,VolumeName,VolBytes/(1024*1024*1024) AS GB,Storage.Name
> AS Storag
> e,Slot,Pool.Name AS Pool,MediaType,VolStatus
>   FROM Media,Storage
>   LEFT JOIN Pool ON Media.PoolId=Pool.PoolId
>   WHERE (Slot > 0) AND (InChanger=1)
>   AND Media.StorageId=Storage.StorageId
>   ORDER BY MediaType ASC, Slot ASC;
> # 18
>
> :List media metadata concerning life-time
>
> SELECT VolumeName AS Volume,VolMounts AS Mounts,VolErrors AS Errors,
>          VolWrites AS Writes,VolStatus AS Status
>   FROM Media
>   WHERE (VolErrors>0) OR (VolStatus='Error') OR (VolMounts>50) OR
>          (VolStatus='Disabled') OR (VolWrites>3999999)
>    ORDER BY VolStatus ASC, VolErrors,VolMounts,VolumeName DESC;
> # 19
>
> :List all backups for a client with FileSet:
>
> *Enter Client Name:
> SELECT DISTINCT Job.JobId AS JobId,Client.Name AS Client,
>    FileSet.FileSet AS FileSet,Level,StartTime,JobFiles,
>    LPAD(ROUND(JobBytes/1024/1024,2),10,' ') AS MBytes,VolumeNAme FROM
> Client,
>    Job,JobMedia,Media,FileSet
>    WHERE Client.Name='%1' AND Client.ClientId=Job.ClientId
>    AND JobStatus='T' AND Job.FileSetId=FileSet.FileSetId
>    AND JobMedia.JobId=Job.JobId AND JobMedia.MediaId=Media.MediaId
>    ORDER BY Job.StartTime;
> # 20
>
> :List all Media
>
> SELECT VolumeName,MediaId,VolStatus,VolBytes/1024/1024 AS
> MBytes,VolFiles,Recycl
> e,Slot,InChanger,MediaType,LastWritten FROM Media ORDER BY VolumeName ASC;

-- 
Best regards,

Kern

  (">
  /\
  V_V


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to