On 9/8/22 13:38, Martin Simmons wrote:
If you can express it in SQL, then you can use that to select a job, e.g. I
use this for testing:

Job {
   Name = "CopyLastBackupJob"
   Type = Copy
   Selection Type = SQLQuery
   Selection Pattern = "select jobid from job where type='B' and jobbytes > 1 order 
by jobtdate desc limit 1"
   ...
}


I use the following:

  Selection Type = SQL Query
  Selection Pattern = "SELECT DISTINCT J.JobId, J.StartTime
                       FROM Job J JOIN Pool P ON P.PoolId = J.PoolId
                       WHERE P.Name = 'Full-Disk'
                       AND J.Type = 'B'
                       AND J.JobStatus IN ('T','W')
                       AND J.jobBytes > 0
                       AND J.StartTime > now() - interval 48 hour"


(I don't actually need the J.StartTime on the first line there, it was there for testing the query, but it does no harm.)


--
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958


_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to