On Friday, March 14th, 2025 at 21:27, Gary R. Schmidt 
<g...@mcleod-schmidt.id.au> wrote:

> On 15/3/25 01:24, Bill Arlofski via Bacula-users wrote:
> 

> > On 3/14/25 5:22 AM, Gary R. Schmidt wrote:
> > 

> > > As a cronjob I'd put "echo query 22 | bconsole" in a file and execute
> > > that.
> > > 

> > > Cheers,
> > > Gary B-)
> > 

> > This will not work. :)
> 

> Works perfectly for me:
> $ echo "echo query 22 | bconsole" > fred.sh
> 

> $ chmod a+x fred.sh
> $ ./fred.sh
> Connecting to Director MY_DIRECTOR:9101
> 1000 OK: 103 MY_DIRECTOR-dir Version: 9.4.2 (04 February 2019)
> Enter a period to cancel a command.
> query 22
> Automatically selected Catalog: MyCatalog
> Using Catalog "MyCatalog"

Hello Gary,

Your method will not work for any queries that ask for input.

I have a custom query.sql, and option 22 in mine requires manual input because 
it asks for a pool or volume name - or something, I can't recall in this moment.

This is what triggered my unwavering "this will not work" comment. :)

Although, I must admit, I didn't think the bconsole query command would accept 
anything on the command line - I still learn something new every day I guess, 
even after 20+ years of using Bacula. :)


Best regards,
Bill

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to