"Fossies" - the Fresh Open Source Software Archive

Member "bareos-Release-21.1.4/core/src/cats/dml/0007_list_jobs_long" (5 Aug 2022, 1085 Bytes) of package /linux/misc/bareos-Release-21.1.4.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "0007_list_jobs_long": 21.1.3_vs_21.1.4.

    1 #
    2 # "WHERE JobId > 0" is a dummy where clause,
    3 #                   to make it easier to extend the filter
    4 #                   (all filters starts with "AND ...")
    5 # JOIN with Media is required for filter to Media.Volumename.
    6 #
    7 
    8 SELECT DISTINCT Job.JobId, Job.Job, Job.Name, Job.PurgedFiles, Job.Type, Job.Level,
    9 Job.ClientId, Client.Name as Client, Job.JobStatus, Job.SchedTime, Job.StartTime,
   10 Job.EndTime,Job.RealEndtime,
   11 CASE
   12     WHEN Job.endtime IS NOT NULL AND Job.endtime >= Job.starttime THEN Job.endtime - Job.starttime
   13     ELSE CURRENT_TIMESTAMP(0) - Job.starttime
   14     END as Duration,
   15 Job.JobTDate, Job.VolSessionId, Job.VolSessionTime,
   16 Job.JobFiles, Job.JobBytes, Job.JobErrors, Job.JobMissingFiles, Job.PoolId,
   17 Pool.Name as PoolName, Job.PriorJobId, Job.FileSetId, FileSet.FileSet
   18 FROM Job
   19 LEFT JOIN Client ON Client.ClientId=Job.ClientId
   20 LEFT JOIN Pool ON Pool.PoolId=Job.PoolId
   21 LEFT JOIN JobMedia ON JobMedia.JobId=Job.JobId
   22 LEFT JOIN Media ON JobMedia.MediaId=Media.MediaId
   23 LEFT JOIN FileSet ON FileSet.FileSetId=Job.FileSetId
   24 WHERE Job.JobId > 0
   25 %s
   26 ORDER BY StartTime%s;