I haven't seen it explicitly explained in this thread, so here is some information about the bconsole query command.
Throughout this email, I will assume you installed bacula using the bacula community repositories, which installs bacula in the /opt/bacula/ folder by default. If your bacula files are located somewhere else, please adjust accordingly. The bconsole query command uses the query file specified in your bacula-dir.conf, in the QueryFile resource. By default, this file is /opt/bacula/scripts/query.sql. Check the QueryFile resource in bacula-dir.conf to see where this file is located for your system. This file only has a single sample query in it by default. You can add more queries yourself. There are more sample queries in the /opt/bacula/scripts/sample-query.sql. The file numbers queries based on their order, from top to bottom. The #1, #2, etc at the top of the queries are only comments for ease of use by admins. The query command handles the counting itself. In Gary's query, the text after the colon (:) is a comment to describe the query, for use when running the bconsole query command in interactive mode. Like this: *query Available queries: 1: The default file is empty, see /opt/bacula/scripts/sample-query.sql for samples 2: List volumes in Order of LastWritten Choose a query (1-2): You should not need to reload the director after saving changes to the query file. Locate your own query file by checking your bacula-dir.conf file for the QueryFile resource. grep QueryFile /opt/bacula/etc/bacula-dir.conf # this should do it, if your bacula dir conf file is located in /opt/bacula/etc/ You are free to change the QueryFile resource to point to a query file of your choice. Make sure you are backing up your query.sql file with your bacula configuration and catalog, for disaster recovery purposes. Once you populate this file with your own queries, it will become part of your essential bacula configuration, possibly necessary for the proper functioning of the bacula system. Regards, Robert Gerber 402-237-8692 r...@craeon.net
_______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users