On Mon, Jan 30, 2006 at 03:15:54PM +0000, Martin Simmons wrote: > TotalBytes and TotalFiles don't work because the SchedTime is not unique and > clients can have multiple filesets (which are not unique either). It also > counts non-backups jobs (restore, verify). > > Maybe something this would be better (for TotalFiles):
Yup, your query works better - I had forgotten that a FileSet is not necessarily unique to a single client. I had to tweak the query slightly to run on MySQL, though - am I correct is guessing that you're running PostgresQL? If so, does this version work for you and produce the same results? select sum(J1.JobFiles) from Job as J1 where J1.JobId = ( select J2.JobId from Job as J2 where J2.Name = J1.Name and J2.Type = 'B' and J2.Level = 'F' and J2.JobStatus = 'T' order by J2.SchedTime desc limit 1 ); -- Frank Sweetser fs at wpi.edu | For every problem, there is a solution that WPI Network Engineer | is simple, elegant, and wrong. - HL Mencken GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC ------------------------------------------------------- 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://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users