|
From: Dan L. <da...@la...> - 2012-06-22 14:52:46
|
On 2012-06-21 19:54, Mike Hobbs wrote:
> Hello, I was wondering if anyone has written a bacula query that you
> can
> run to find out what clients haven't been backed up within a certain
> time period? If so could you share? I'm not an SQL guy which is why
> I
> am asking.
This query provides a list of all clients who have not had a backup
finish within the past week:
SELECT C.name
FROM client C
WHERE NOT EXISTS (SELECT jobid
FROM job J
WHERE J.endtime > (now() - interval '1 week')
AND J.clientid = C.clientid)
ORDER BY name
This was written for PostgreSQL. I hope it runs on MySQL with minor
modifications.
--
Dan Langille - http://langille.org/
|