Habilitando as consultas modelo no bconsole

Por padrão, o comando “query” no bconsole retorna apenas uma informação dizendo é vazio e mostra a localização do arquivo de consultas modelo. Para utilizar estas consultas modelo, é preciso copiar o arquivo “sample-query.sql” que geralmente se encontra em “/opt/bacula/scripts/” ou dentro do diretório “examples” onde foi extraído o código fonte, para o diretório “/etc/bacula/scripts”.

cp /root/bacula-7.4.0/examples/sample-query.sql  /etc/bacula/scripts/query.sql

Configure no bacula-dir.conf na diretiva Director o parâmetro QueryFile:

QueryFile = "/etc/bacula/scripts/query.sql".

Acesse o bconsole, digite o comando “reload”, para recarregar as configurações, e então as consultas modelo estarão disponíveis com o comando query.

*query
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Available queries:
1: List up to 20 places where a File is saved regardless of the directory
2: List where the most recent copies of a file are saved
3: List last 20 Full Backups for a Client
4: List all backups for a Client after a specified time
5: List all backups for a Client
6: List Volume Attributes for a selected Volume
7: List Volumes used by selected JobId
8: List Volumes to Restore All Files
9: List Pool Attributes for a selected Pool
10: List total files/bytes by Job
11: List total files/bytes by Volume
12: List Files for a selected JobId
13: List Jobs stored on a selected MediaId
14: List Jobs stored for a given Volume name
15: List Volumes Bacula thinks are in changer
16: List Volumes likely to need replacement from age or errors
17: List Volumes Bacula thinks are eligible for the changer
18: List Volumes by Volume:
19: List Volumes by Jobs:
20: List Volumes for a jobname:
Choose a query (1-20):
Facebooktwittergoogle_pluslinkedinFacebooktwittergoogle_pluslinkedinby feather