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"
+---------+------------+--------+--------------+------+-----------+---------------------+---------------------+-----------+-------------+-------------------+
| mediaid | volumename | poolid | pool | slot | inchanger | firstwritten | lastwritten | volstatus | expiresin | volbytes |
+---------+------------+--------+--------------+------+-----------+---------------------+---------------------+-----------+-------------+-------------------+
... Some lines deleted ...
| 24 | SRC023L6 | 3 | Full | 0 | f | 2023-10-15 11:32:29 | 2023-11-11 17:08:04 | Full | 0 | 5,142,215,783,424 | | 25 | SRC024L6 | 3 | Full | 0 | f | 2023-11-11 17:11:31 | 2023-12-02 13:36:14 | Full | 0 | 3,843,057,685,504 | | 15 | SRC013L6 | 3 | Full | 0 | f | 2023-12-02 13:39:46 | 2023-12-11 04:16:26 | Full | 0 | 3,971,347,145,728 | | 23 | SRC022L6 | 5 | Incremental | 0 | f | 2023-11-08 03:46:59 | 2024-01-09 08:33:54 | Full | 0 | 7,883,044,682,752 | | 19 | SRC018L6 | 3 | Full | 0 | f | 2023-12-11 04:19:49 | 2024-01-13 18:00:13 | Full | 0 | 5,494,087,708,672 | | 16 | SRC015L6 | 3 | Full | 5 | t | 2025-01-11 17:25:47 | 2025-01-25 10:11:31 | Full | 26,855,295 | 3,458,766,681,088 | | 6 | SRC004L6 | 3 | Full | 8 | t | 2025-01-25 10:14:38 | 2025-02-13 05:31:00 | Full | 28,480,064 | 4,618,357,519,360 | | 3 | SRC003L6 | 5 | Incremental | 3 | t | 2024-12-10 07:34:30 | 2025-02-25 07:48:29 | Full | 29,525,113 | 7,691,197,839,360 | | 12 | SRC011L6 | 3 | Full | 4 | t | 2025-02-13 05:34:12 | 2025-03-02 23:13:18 | Full | 30,012,602 | 4,561,460,785,152 | | 43 | SRC042L6 | 5 | Incremental | 2 | t | 2025-02-25 07:51:28 | 2025-03-14 06:48:45 | Append | 30,990,329 | 1,823,328,982,016 | | 41 | SRC040L6 | 4 | Differential | 1 | t | 2024-09-28 06:13:34 | 2025-03-15 05:55:14 | Append | 31,073,518 | 3,973,349,672,960 | | 2 | SRC002L6 | 3 | Full | 7 | t | 2025-03-02 23:16:25 | 2025-03-15 11:59:15 | Full | 31,095,359 | 3,660,236,823,552 | | 18 | SRC017L6 | 3 | Full | 6 | t | 2025-03-15 12:02:17 | 2025-03-15 13:00:35 | Append | 31,099,039 | 324,991,714,304 |
+---------+------------+--------+--------------+------+-----------+---------------------+---------------------+-----------+-------------+-------------------+


But, you *could* do:
----8<----
echo -e "query\n22\nquit\n" | bconsole
----8<----

That'll work, but it's not as readable.

        Cheers,
                Gary    B-)


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

Reply via email to