Mandag 27 november 2006 18:01 skrev du:
> In the message dated: Fri, 24 Nov 2006 14:03:05 +0100,
> The pithy ruminations from steen meyer on
> <Re: [Bacula-users] Listing jobs and volumes...> were:
> => Fredag 24 november 2006 12:40 skrev Jaime Ventura:
> => > Thank you for your reply.
> => > I knew about the "list jobmedia" command.
> => > But I wanted  both results(job media and jobs) merged using just one
> => > command.
> =>
> => I have made this query addition:
> =>
> =>     18: List Volumes by Jobs:
> =>     19: List Volumes for a jobname:
>
> Those sound like very useful queries. Could you please post the SQL code to
> the mailing list 

Already did friday - and they come here below too
> (and submit it to Kern as an addition to future releases)? 

This I did not do because I have not examined if it is already present in the 
latest releases, which I am not running at the moment, and I don't know if it 
will work with the database changes since 1.38.0, but maybe Kern can tell at 
a glance;-) so here we go: (note that the first two list all volumes in the 
database)

# 17
:List Volumes by Volume:
SELECT VolumeName, Job.JobId as JobID, Job.Name as JobName, Job.StartTime as
Start, sum(JobFiles) AS Files,sum(JobBytes) AS Bytes
 FROM Job,JobMedia,Media
 WHERE JobMedia.JobId=Job.JobId
 AND JobMedia.MediaId=Media.MediaId
 GROUP by VolumeName, Job.JobID, Job.Name, Job.StartTime
 ORDER by VolumeName;
# 18
:List Volumes by Jobs:
SELECT Job.Name as JobName, Job.JobId as JobID, VolumeName, Job.StartTime as
Start, sum(JobFiles) AS Files,sum(JobBytes) AS Bytes
 FROM Job,JobMedia,Media
 WHERE JobMedia.JobId=Job.JobId
 AND JobMedia.MediaId=Media.MediaId
 GROUP by VolumeName, Job.JobID, Job.Name, Job.StartTime
 ORDER by JobName, Start;
# 19
:List Volumes for a jobname:
*Enter Job name:
SELECT Job.Name as JobName, Job.JobId as JobID, VolumeName, Job.StartTime as
Start, sum(JobFiles) AS Files,sum(JobBytes) AS Bytes
 FROM Job,JobMedia,Media
 WHERE Job.Name='%1'
 AND JobMedia.JobId=Job.JobId
 AND JobMedia.MediaId=Media.MediaId
 GROUP by VolumeName, Job.JobID, Job.Name, Job.StartTime
 ORDER by JobName, Start;


Regards

Steen
>
> Thanks,
>
> Mark
>
>       [SNIP!]
> =>
> => Is it something like this you are looking for?
> =>
> => Steen
> =>
>
> ----
> 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.upen
>n.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
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to