Hi,

śr., 27 sie 2025 o 16:11 Konstantin Kharlamov <[email protected]>
napisał(a):

> Hello, I'm writing a GUI around Bacula (yeah, another one), and my
> problem is I want to receive every job status change, e.g. if it's
> running, failed, etc, to display to the user interactively.
>

It is very easy, just connect to the database and do a proper query. Then
your web application (gui) can just refresh the data periodically - I'm
using 1 min interval in IBAdmin.


>
> After digging far and wide, I figured the only way to do it is by changing
> `bacula-dir.conf` to have:
>
>     Messages {
>       Name = Daemon
>       append = "/tmp/dir-messages-named-pipe" = all, events, debug
>     }
>
> Per my understanding, this should send everything to
> /tmp/dir-messages-named-pipe. I know for a fact job status changes are
> part of
> the logs, because if you launch `bconsole` (assuming you have `console =
> all`
> option) and execute `messages`, you see job status changes info.
>

You need to check the source code to ensure this is not blocking, else your
job will be stuck when your gui backend won't read this fast enough or is
it buffered output which means the log will be saved (flushed) after the
job finishes.


> Yet somehow, even though it works for console, I never see that info in the
> /tmp/dir-messages-named-pipe!
>
>
Reading logs is not the "best" way to get the functionality you need b/c
you need to parse a human readable text to collect required data. This is
hard to do in a proper way, unstable and prone to errors. Not to mention
you need to update your scanning procedure on every change and support
multiple procedures if you want to support multiple bacula versions.

Reading job status from the database is always correct.

I hope this helps.
-- 
Radosław Korzeniewski
[email protected]
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to