On Wed, Feb 13, 2013 at 08:08:34PM +0100, Masopust, Christian wrote: > > :List all Jobs needed for a disaster recovery for a jobname: > *Enter Job name: > SELECT DISTINCT Job.JobId,StartTime FROM Job WHERE Job.Name = '%1' AND ( > (Level='F' AND JobStatus IN ('T', 'W') AND > Job.StartTime >= ( > SELECT DISTINCT StartTime > FROM Job > WHERE Job.Name = '%1' > AND Level='F' AND JobStatus IN ('T', 'W') ORDER BY StartTime DESC LIMIT > 1 > ) > ) OR > (Level='D' AND JobStatus IN ('T', 'W') AND > Job.StartTime >= ( > SELECT DISTINCT StartTime > FROM Job > WHERE Job.Name = '%1' > AND Level='F' AND JobStatus IN ('T', 'W') ORDER BY StartTime DESC LIMIT > 1 > ) > ) OR > (Level='I' AND JobStatus IN ('T', 'W') AND > Job.StartTime >= ( > SELECT DISTINCT StartTime > FROM Job > WHERE Job.Name = '%1' > AND Level='D' AND JobStatus IN ('T', 'W') AND > Job.StartTime >= ( > SELECT DISTINCT StartTime > FROM Job > WHERE Job.Name = '%1' > AND Level='F' AND JobStatus IN ('T', 'W') ORDER BY StartTime DESC > LIMIT 1 > ) > ORDER BY StartTime DESC LIMIT 1 ) > ) > ) ORDER BY JobId; >
Hi Christian, thanks for sharing, I'm glad the query.sql got you on your way. If you manage to "shoe-horn" a client or job name dynamically into a copy job definition then please let me know ;) All the best, Uwe -- NIONEX --- Ein Unternehmen der Bertelsmann SE & Co. KGaA ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users