Phil Stracchino schrieb am 02.10.23 um 19:57:
On 10/2/23 13:39, Rob Gerber wrote:
I'm not sure, but maybe you'll need to query your database directly
instead of relying on Bacula to simplify that process. *This is not
an educated answer, just my novice guess.*
I see bacula bconsole has a 'query' command that I believe passes SQL
query language commands on to the relevant DB server. Might want to
look into that, possibly in the bacula console operators manual. I've
used the PDF copy of the documentation because it's easier to search.
I'd swear there used to be a 'blist' tool, but I can't for the life of
me find it any more.
This query will list files in a given Job:
SELECT CONCAT(p.Path, f.Filename) FROM File f JOIN Path p ON f.PathId
= p.PathId WHERE f.JobId = <job id>;
If you want only, say .odt files, you could use:
SELECT CONCAT(p.Path, f.Filename) FROM File f JOIN Path p ON f.PathId
= p.PathId WHERE f.JobId = <job id> AND f.Filename LIKE '%.odt';
For example:
MySQL 127.0.0.1> SELECT CONCAT(p.Path, f.Filename) FROM File f JOIN
Path p ON f.PathId = p.PathId WHERE f.JobId = 836 AND f.Filename LIKE
'%.odt';
+--------------------------------------------------+
| CONCAT(p.Path, f.Filename) |
+--------------------------------------------------+
| /home/alaric/Documents/Writing/Bearing Gifts.odt |
| /home/alaric/Documents/Writing/United Fleet.odt |
+--------------------------------------------------+
2 rows in set (0.647 sec)
You can get the LStat field as well, but you'd have to decode it
yourself. I don't remember offhand how LStat is encoded.
Hi
So, quering the database? That is kind of unconvenient, isn't it? I
somehow expected that a backup software would be able to not only write
files somewhere, and hopefully restore, but also maybe extract a single
file I accidentially deleted from a 18TB backup... :-(
So using sqlquery and then entering the SELECT line (it seems that there
must not be a space between "=" and the "jobid", it actually works.
Unfortunately, bacula (installed under Suse Tumbleweed) does not have
anything under "opt", and I can find nowhere the samples... I tried to
google them without any success, because that way I could create some
queries and store them for "query". Any hint?
list files type=all jobid=<jobid>
gives me a full file list of the backup.
It still would be better to get a list with details (date, size etc.)
for ALL files in ALL backups (catalogue) matching a specific criteria
(e.g. (partial)filename, date, etc).
Any ideas how to do this?
Cheers
T
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users