Bacula-users

Re: [Bacula-users] searching the bacula catalog for a filename with wildcards?

2008-11-08 12:13:41
Subject: Re: [Bacula-users] searching the bacula catalog for a filename with wildcards?
From: Bruno Friedmann <bruno AT ioda-net DOT ch>
Date: Sat, 08 Nov 2008 18:11:11 +0100
Bob Hetzel wrote:
> Folks,
> 
> I've got a user who thinks a file was deleted but she isn't sure of the 
> exact name or where it was in the file system.  Is there a command to 
> search for a file with wildcards which could be anywhere in the catalog 
> (where both the date it was backed up and the directory it lived in are 
> not known)?
> 
> Barring that, what might the syntax of a mysql select command to do it?
> 
>    Bob
> 
A query ( choose sqlquery in bconsole ) or directly against the db
Insipired from the /usr/lib/bacula/query.sql choice 1
something like that

SELECT DISTINCT Job.JobId as JobId, Client.Name as Client, 
Path.Path,Filename.Name,StartTime,Level,JobFiles,JobBytes FROM
Client,Job,File,Filename,Path WHERE Client.ClientId=Job.ClientId  AND 
JobStatus='T' AND Job.JobId=File.JobId  AND
Path.PathId=File.PathId AND Filename.FilenameId=File.FilenameId  AND 
Filename.Name LIKE '%FIND ME%' ORDER BY Job.StartTime
LIMIT 100;
for mysql ... you could adjust if you use postgresql.


-- 

     Bruno Friedmann

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>