Question

Is it possible to obtain the status of Bacula backup system Director in some parseable format?

It looks like the human-readable representation (one you can see when using bacula-console) is formed on the director side during the TCP control connection.

Was it helpful?

Solution

You can also pull directly from the database, depending on your needs.

Example:

mysql> select JobId, Name, JobStatus from Job ORDER BY JobId DESC Limit 10;
+--------+-------------------------------------+-----------+
| JobId  | Name                                | JobStatus |
+--------+-------------------------------------+-----------+
| 231215 | dbs16 Daily MysqlC XBM Snapshot | T         | 
| 231214 | dbs09 Daily MysqlS XBM Snapshot | T         | 
| 231213 | dbs10 Daily MysqlQ XBM Snapshot | T         | 
| 231212 | dbs11 Daily MysqlT XBM Snapshot | T         | 
| 231211 | dbs16 Daily MysqlI XBM Snapshot | T         | 
| 231210 | dbs19 Daily MysqlE XBM Snapshot | T         | 
| 231209 | dbs18 Daily MysqlB XBM Snapshot | R         | 
| 231208 | dbs17 Daily MysqlG XBM Snapshot | R         | 
| 231207 | Daily Catalog Backup            | C         | 
| 231206 | adm6 svnops SVN Backup          | R         | 
+--------+-------------------------------------+-----------+

OTHER TIPS

In what language? The easiest way would be to invoke bconsole and send command as stdin, then parse stdout and stderr.

Bacula has interactive mode in bconsole, but if you know commands in advance, this is not an issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top