I noticed an error in the $BACULA/bin/query.sql query #3, which is supposed to 
list the last 20 full backups for a client. As written, in my 1.38.11 release 
of bacula (soon to be upgraded), the query was selecting the last 20 distinct 
records, including the JobMedia.StartFile. I found that there were more than 20 
distinct records for each full backup, thus the output of the query was only 
showing data on the most recent backup. For all I know, this has already been 
corrected in the latest bacula release.

Here's the updated query, which now works correctly for me:

##############################################################################
:List last 20 Full Backups for a Client
*Enter Client name:
SELECT DISTINCT Job.JobId,Client.Name AS Client,StartTime,JobFiles,JobBytes,
  VolumeName
 FROM Client,Job,JobMedia,Media
 WHERE Client.Name='%1'
 AND Client.ClientId=Job.ClientId
 AND Level='F' AND JobStatus='T'
 AND JobMedia.JobId=Job.JobId AND JobMedia.MediaId=Media.MediaId
 ORDER BY Job.StartTime DESC LIMIT 20;
###############################################################################

The diff being:
#######################################################################
--- query.sql   2007-01-17 12:01:25.000000000 -0500
+++ query.sql-fixed     2007-01-17 12:01:36.000000000 -0500
@@ -29,7 +29,7 @@
 :List last 20 Full Backups for a Client
 *Enter Client name:
 SELECT DISTINCT Job.JobId,Client.Name AS Client,StartTime,JobFiles,JobBytes,
-  JobMedia.StartFile as VolFile,VolumeName
+  VolumeName
  FROM Client,Job,JobMedia,Media
  WHERE Client.Name='%1'
  AND Client.ClientId=Job.ClientId
########################################################################

Mark "exposing my ignorance of SQL daily" Bergman

----
Mark Bergman                      [EMAIL PROTECTED]
System Administrator
Section of Biomedical Image Analysis             215-662-7310
Department of Radiology,           University of Pennsylvania

http://pgpkeys.pca.dfn.de:11371/pks/lookup?search=mark.bergman%40.uphs.upenn.edu



The information contained in this e-mail message is intended only for the 
personal and confidential use of the recipient(s) named above. If the reader of 
this message is not the intended recipient or an agent responsible for 
delivering it to the intended recipient, you are hereby notified that you have 
received this document in error and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you have 
received this communication in error, please notify us immediately by e-mail, 
and delete the original message.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to